Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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

In reply to Re: Stupid newbie question - perl/cgi by ilcylic
in thread perl/cgi question: script works from unix command line, but not web page by geoffhanna

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

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

    No recent polls found