Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

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

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


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
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2023-06-06 08:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you go to conferences?






    Results (26 votes). Check out past polls.

    Notices?