Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: Stupid newbie question - perl/cgi

by ilcylic (Scribe)
on Apr 03, 2002 at 02:18 UTC ( #156209=note: print w/replies, xml ) Need Help??

in reply to perl/cgi question: script works from unix command line, but not web page

Another useful resource besides the web, and PM, would be a copy of the Llama and Camel books, (as they are somewhat colloquially known) from O'Reilly. Llama refers to the book Learning Perl, and Camel refers to Programming Perl. If you could only afford one, I'd recommend Learning Perl first, as it is aimed more towards the person who needs a starting place in the language. I have fgound these books to be an invaluable resource in my quest to become a better perl programmer. If you already have these books, then you can ignore this advice. :)

A thought though. You might want to check the return value of the open() function when you call it to find out if it's been successful. If the open() is failing, then that would explain why the file isn't getting written. If you did something like open FILEHANDLE, ">filename.txt" or warn "Cannot open file for writing, $!"; the system (assuming you can read the server log files) will tell you *that* it didn't open the file, and *why* it didn't open it. (That's what that $! thing is.)

You could even do something like (making sure you've already printed the html header) open FILEHANDLE, ">filename.txt" or print "Couldn't open file, $!"; and it'll print to the browser window. You won't even have to read the server log file.

I hope this helps some.

-il cylic

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2022-08-10 13:22 GMT
Find Nodes?
    Voting Booth?

    No recent polls found