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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi, Am pretty new to perl scriptin

Status
Not open for further replies.

ahksar

Programmer
Jan 11, 2001
43
US
Hi,
Am pretty new to perl scripting...I was just doing an online poll, and I get this error...
PerlScript: ERROR reading config.txt
I have changed the permission to the config.txt as 755
The code I have in my vote.pl script is as follows...
$config="config.txt .....and
if (!open(filehandle1,$config)) {printError("ERROR reading $config\n
vote.pl and config.txt are in the cgi-bin directory...
Any feedback will be appreciated...
Thanks
ahksar
 
This is a pretty self explanitory error. The 'open' function is failing. Either, you have described the location of 'config.txt' inappropriately or the web daemon does not have read permissions for it.

Try fully qualifying the path to 'config.txt'.

$config = '/some/path/httpd/cgi-bin/config.txt';
if (!open(filehandle1,&quot;<$config&quot;)) { printError......

And, make sure the everyone can read the file. If you want tighter security than that, tighten the permissions and chown on it after you get the basics working.

'hope this helps.


keep the rudder amid ship and beware the odd typo
 
Try

printError(&quot;ERROR reading $config\n$!\n&quot;);

And you should get a nice(ish) error message in your output when it goes wrong.
Mike
michael.j.lacey@ntlworld.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top