Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Can't open file using Perl as CGI

by pc88mxer (Vicar)
on May 19, 2008 at 21:46 UTC ( [id://687476]=note: print w/replies, xml ) Need Help??


in reply to Can't open file using Perl as CGI

It's likely there's an error, but you have to check for it:
open(INFILE, '<', 'textfile.txt') or die "unable to open textfile.txt: + $!"; ...
and this will show the error in your server's error log.

My guess is that you need to specify an absolute path for textfile.txt.

Replies are listed 'Best First'.
Re: Can't open file using Perl as CGI
by timtowtdi (Sexton) on May 19, 2008 at 22:03 UTC
    That was it! The "or die"-addition!
    I already checked whether the script was running in the correct directory, and it did. It turned out to be quite easy: The rights set on 'textfile' weren't right; Apache wasn't able to read.
    Thanks Monks! You really helped me out!

    The great mistake is to anticipate the outcome of the engagement; Let nature take it's course, and your tools will strike at the right moment.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://687476]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2024-04-23 23:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found