Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Having repeated intances become one in Array

by vek (Prior)
on Aug 09, 2002 at 18:05 UTC ( [id://188990]=note: print w/replies, xml ) Need Help??


in reply to Having repeated intances become one in Array

There are a couple of different ways to handle your dilemma , here's one method using a hash to keep track of what you've already seen:
my %seen; for my $foo (@array) { print $foo unless $seen{$foo}++; }
-- vek --

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2024-04-25 15:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found