Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: What does !$saw{$_}++ means

by ikegami (Patriarch)
on Jan 26, 2005 at 16:54 UTC ( [id://425276]=note: print w/replies, xml ) Need Help??


in reply to What does !$saw{$_}++ means

!$saw{$_}++
is
!$saw{$_}++
is
!($saw{$_}++)
is
!(do { my $previously_seen = $saw{$_}; $saw{$_} += 1; $previously_seen })
is
do { my $previously_seen = $saw{$_}; $saw{$_} += 1; !$previously_seen }
is a simplification of:
do { my $previously_seen = $saw{$_}; $saw{$_} = 1; !$previously_seen }
means (when in context of the grep)
If the string we're looking at is in %saw, return false. Otherwise, add that string to %saw and return true.
means (when in context of the grep)
Remove duplicates.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2024-04-20 01:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found