in reply to Re^5: Looking for pointers or optimizations.
in thread Looking for pointers or optimizations.
On the other hand, I don't understand the last line - you read a file into array with my @words = <$fh>; and then you assign it to a scalar variablemy $words = @words;.open(my $fh, "<", $ARGV[0]) or die "cannot open input file: $!"; my @words = <$fh>; close $fh or die "cannot close input file: $!"; ############## my $words = @words;
OK, you probably have your own reasons for that but you could manipulate array as good as scalar. And you could read a file directly in a scalar variable. my $words = <$fh>;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: Looking for pointers or optimizations.
by chromatic (Archbishop) on Aug 21, 2012 at 19:59 UTC | |
by SerZKO (Beadle) on Aug 22, 2012 at 06:16 UTC | |
|
Re^7: Looking for pointers or optimizations.
by choroba (Cardinal) on Aug 21, 2012 at 19:58 UTC |