Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

What does 'next if $hash{$elem}++;' mean?

by Win (Novice)
on Feb 17, 2006 at 15:21 UTC ( [id://530966]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    next if $seen{ $elem }++;
    
  2. or download this
     my %hash   = map { $_, 1 } @array;
    
    ...
         next if $seen{ $elem }++;
         push @unique, $elem;
       }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-04-24 03:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found