Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

For starters, all people new to Perl should be made aware of strict.pm. This is a Perl Module that ensures your program runs smoothly with regard to Scoping. You should also read up on use warnings; or the -w switch, which basically adds an extra level of integrity to your program.

Also on your filehandle call, you should always finish the statement off with or die "Could not open $fh : $!\n"; The die function enables error handling, storing the error value in the special variable $!. So your code should now look like

open CHAT, ">>../chatty2.html" or die "Could not open file : $!\n"; # your script will fail if you can't open the file, and print the reas +on why
In fact, you should use die on most function calls. Read up on that, it'll save you a lot of heartache in the future.

Finally, enjoy your time on Perlmonks. It's a very nice place.

Azatoth a.k.a Captain Whiplash

Make Your Die Messages Full of Wisdom!
Get YOUR PerlMonks Stagename here!
Want to speak like a Londoner?

In reply to Re: Seeking Feed back by azatoth
in thread Seeking Feedback on Chat Program (was Seeking Feed back) by Cobo

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 browsing the Monastery: (8)
As of 2024-04-18 11:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found