[thelist] Perl, SSI, Paths and JS?

Sabrina Dent, Apperception sabrina.dent at appercept.co.uk
Thu Feb 7 10:01:19 CST 2002

I confess I am Perl illiterate. However, I've done a lot of modifications to
a gallery display script written in Perl, and I'm having two final, simple
problems I'm hoping someone could help me with.

The script is in the sites CGI bin, ala
http://www.mydomain.com/cgi-bin/picture_frame.pl which delivers a page of
clickable thumbnails, linking to larger images ala picture_frame.pl?041.jpg.
This works well. The following, however, does not:

1/ The paths

I'm including the script in a test layout using SSI: <!--#exec
cgi="/cgi-bin/picture_frame.pl"--> on a page thusly:


When you click a thumbnail on the include, the path is incorrect and the
large image won't load because it's trying to link to
http://www.mydomain.com/newtest/current/picture_frame.pl?041.jpg and not

* How do I correct the path?

2. Pop-Ups

I actually want the large image to appear in a pop-up, the JS code of which
is already in gallerytest.shtml. Therefore, I need to edit the <a href> tag
in the Perl script to include the openWindow command, and I don't know how
to do that.

The Perl code as it is:
<a href=\"$script_name\?$tnlist[($anum * 1)]\">

And the JS code is:
<a href="JavaScript:openWindow2('pop_icon_legend.asp')">

So what I'm looking for is something like:
<a href=\"JavaScript:openWindow2('$script_name\?$tnlist[($anum * 1)]\')">

...which doesn't work - probably for reasons embarrassingly obvious to all
but me!

* How do I add the pop-up to the script?

Many thanks to any Perl people who can lend a few lines of code!


More information about the thelist mailing list