Beefy Boxes and Bandwidth Generously Provided by pair Networks chromatic writing perl on a camel
Perl: the Markov chain saw
 
PerlMonks  

Re: Re: Unique array w/o repeated elements and still keep the original order!

by robobunny (Friar)
on Aug 09, 2002 at 15:50 UTC ( [id://189019]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Re: Unique array w/o repeated elements and still keep the original order!
in thread Unique array w/o repeated elements and still keep the original order!

i'm assuming it was just a typo, but i think you meant:
foreach my $instance (@lines2) { print OUTF $instance unless $hsh{$instance}++; }
as written, it will only print the duplicates.
  • Comment on Re: Re: Unique array w/o repeated elements and still keep the original order!
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://189019]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.