Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: audit.pl

by cjf (Parson)
on Mar 09, 2002 at 10:39 UTC ( [id://150529]=note: print w/replies, xml ) Need Help??


in reply to audit.pl

Hi, just a few general suggestions that will make your life a bit easier:

  • use strict
  • Turn on warnings (-w)
  • Check all of your open calls like so:
    open OUTFILE, ">outfile.txt" or die "Can't open outfile.txt: $!\n";

 

Replies are listed 'Best First'.
Re: audit.pl
by Arcanum (Sexton) on Mar 11, 2002 at 19:34 UTC
    Thanks for your suggestions.

    I generally use the -w flag, but I didn't want this to throw warnings to unsuspecting users. It should only be used by 3 people, anyhow. Using -w on the command line doesn't trow warnings for this one.

    I've never used strict, but I have seen it mentioned before. It is my understanding that it forces me to predefine my variables. This will avoid problems down the line caused by variables with uncertain values. Is that correct?

    Error checking has never been one of my strong points :P But yes, you are correct, I should check for the ability to open the output file.

    By the way, how would I add the -w flag to the script in Windows? Most of my (limited) Perl coding has been on Linux, so I've just needed to add it to the #!/usr/bin/perl line.

    Thanks again!

Log In?
Username:
Password:

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

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

    No recent polls found