Gossamer Forum
Home : General : Perl Programming :

How to open data file in cgi script?

Quote Reply
How to open data file in cgi script?
I want to open a data file in a cgi script then i want to be able for the all the contents to read as though it were all located inside the script so if there was a an array @engines it could be used with out have to get it from the file and naming it something different!

Thank You,
Vince Urmanski
Quote Reply
Re: How to open data file in cgi script? In reply to
Yea, this should go into your CGI script:

Code:
require "/path/variables.pl";
print = "Hello, I am $myname, I am $myage, my website is <a href=\"$myURL\">$myURL</a>.";

And this is your variables file:

Code:
$myURL = "http://www.yahoo.com";
$myhomedir = "/usr/yahoo";
$mywebdir = "/usr/yahoo/public_html";
$myeamil = "webmaster\@yahoo.com";
$myname = "John Doe";
$myage = "22";

Is this what you wanted?

Regards,

Pasha

------------------
find.virtualave.net
Quote Reply
Re: How to open data file in cgi script? In reply to
yea that is exactly what I wanted thanks alot
Quote Reply
Re: How to open data file in cgi script? In reply to
try putting the rquire stament at the top:

require "file.name";



------------------