Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Chat Client Paste Parser

by Hofmator (Curate)
on Aug 29, 2001 at 13:53 UTC ( #108722=note: print w/replies, xml ) Need Help??


in reply to Chat Client Paste Parser

Some quick comments:

  • Your open statements should check if they succeed, something like this works: open (INPUT, $ARGV[0]) or die "Couldn't open $ARGV[0]: $!";
  • Don't use a foreach loop here, this reads the whole input file into memory. You want to process the file line by line so just use while (my $line = <INPUT>)
  • Take the open OUTPUT out of the loop. At the moment you are opening and closing the output file for every line you are processing, very inefficient. This is so, because open implicitly closes the file before it opens it again.

-- Hofmator

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2022-01-26 12:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (69 votes). Check out past polls.

    Notices?