Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
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> )


Comment on Re^2: Removing duplicates lines
Select or Download Code
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 perusing the Monastery: (13)
As of 2015-07-31 18:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (280 votes), past polls