Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
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
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 surveying the Monastery: (6)
As of 2014-11-27 18:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (186 votes), past polls