views:

238

answers:

5

I am trying to adapt a perl script that is used to generate a splash page for a public wifi installation. I was only given a couple example files to work from and no documentation. After several hours on the phone with the access point vendor I was told I could "just edit" the examples in order to design our custom page. I am trying to understand what is going on in the files.

I have .css file with the following in it.

#logo_container {
    width: 528px; height: 58px;
    background-image: url(${imagepath}body_title_line.gif);
    border: 0;
}

I also have a .pl file with a variable $html_body_top containing the following snippet of html:

<a href=\"${imagepath}WirelessAUP-ibm.htm\" target=\"_self\">Acceptable Use Policy</a>

What does the ${imagepath} refer to? Can I get at it?

+1  A: 

Looks like the perl script needs to be run with some value of $imagepath. ${imagepath} is equal to the variable $imagepath. The braces are generally used when variables are used in a string, to remove ambiguity

Abhinav
No, the braces can be used at any time, but since their purpose is to remove ambiguity (e.g. "$foobar" vs "${foo}bar") you tend to only see them in interpolation.
Chas. Owens
+1  A: 

Looks like a token that will be replaced by some sort of build script that runs over all the files in the project.

matt b
This was my initial thought too.
Jeffrey Guenther
+1  A: 

I would guess that imagepath is a variable from the perl script, replaced at generation time with the actual URL.

Garry Shutler
+3  A: 

I guess the root directory of your images. So if body_ title_line.gif is under /images/ the imagePath variable will probably need to reflect this.

CSS does not support variables so this is something injected by your PL script.

Janco
+2  A: 

It's possible that's a variable substituted by Template Toolkit, not by your Perl script. It's also possible the Perl script isn't using strict and, due to lack of declaration of the variable, is substituting a blank string in place of ${imagepath}.

ysth