Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing a value from an array into a file reference

Status
Not open for further replies.

ddmama

IS-IT--Management
Jun 3, 2003
5
US
Hello,
I have a fairly complicated perl cgi script that I inherited that I am trying to tweak. Specifically, I need to be able to designate a different file name to be opened depending on what value the script passes back. The filename is stored in one column in a two-dimensional array that is stored in a .csv file.


I am trying to refence that filename in order to designate the html filepath name that should be opened. I am using the following script:

$FILE_PATH = "../htdocs/@fields[12]";

I know that this populates correctly because I can print the value and it returns "../htdocs/document.html" But when I try to actually use it to open ../htdocs/document.html, I get a "page cannot be displayed error"

Any ideas? I've tried any number of variations on this theme...I'm really at a loss.

 
$FILE_PATH = "../htdocs/[red]@[/red]fields[12]";

when refering to a single item in an array, you name the item with a '$'.

$FILE_PATH = "../htdocs/[red]$[/red]fields[12]";

'hope this helps

If you are new to Tek-Tips, please use descriptive titles, check the FAQs, and beware the evil typo.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top