Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: Removing duplicates lines

by Not_a_Number (Parson)
on Sep 04, 2013 at 20:15 UTC ( #1052436=note: print w/ replies, xml ) Need Help??


in reply to Re: Removing duplicates lines
in thread Removing duplicates lines

Small remark.

foreach my $line ( <FILE> )  #### do NOT read entire files into memory if they are big.

With foreach, you ARE reading the whole file into memory!

Use while:

while ( my $line = <FILE> )

Replies are listed 'Best First'.
Re^3: Removing duplicates lines
by zork42 (Monk) on Sep 05, 2013 at 12:01 UTC

    Doh!

    Thanks for pointing that out!
    I've updated my post to remove my stupidity :)
    ++

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2016-07-24 18:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What is your favorite alternate name for a (specific) keyboard key?


















    Results (221 votes). Check out past polls.