in reply to FIle Seeking
Asside from that. You're reading the entire contents of your datafile into memory and then doing stuff with matching rows. Depending on the length of each record, that could be a LOT of memory usage...and may be the source of your woes. Try this instead
you have the same basic functionality, but you're only placing one row into memory at a time.use strict; # this will help you catch a LOT of errors my $tail = "some string"; open(INF,"data.txt") or die "Couldn't open data file: $!"; my $linenum=0; while (<INF>) { print "$linenum\n"; if ($_ =~ /|$tail/) { # do stuff } $linenum++; } close(INF);
HTH
/\/\averick
perl -l -e "eval pack('h*','072796e6470272f2c5f2c5166756279636b672');"
|
|---|