Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Looking for pointers or optimizations.

by aaron_baugher (Deacon)
on Aug 21, 2012 at 13:52 UTC ( #988736=note: print w/ replies, xml ) Need Help??


in reply to Looking for pointers or optimizations.

You have some strange things going on at the top of your file. Comments interspersed:

my $words_file = @ARGV; # Evaluating an array in scalar context returns the length # of the array. So if you are passing your script one filename, # $words_file will equal '1', not the first argument from the # command line. Pass it two filenames, and it will equal 2, etc. # But that doesn't matter, because of another bug: open (my $fh, ">", $words_file); # Here you open the file for writing, but never use it. # (You should also check for errors, or use autodie.) my @words; while (<>) { push(@words, $_); } # Which turns out also not to matter, because you then use # the <> operator, which reads from the files in @ARGV # automagically. So lines 4 & 5 (the first two I quoted), # though broken, don't affect anything else, and could be # discarded.

Aaron B.
Available for small or large Perl jobs; see my home node.


Comment on Re: Looking for pointers or optimizations.
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2014-09-21 13:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (171 votes), past polls