--- Jeff 'japhy/Marillion' Pinyan <[EMAIL PROTECTED]> wrote:
> perl -pe '$_ x= !$seen{$_}++' (attributed to some of Larry's genius)
LOL!!! Twistedly brilliant!
Ok, lemme see if I can parse this.....
perl -pe says print each line after the -e code has been executed.
"$_ x= !$seen{$_}++" says:
$_ x=
assign to $_ itself, repeated a number of times
!$seen{$_}
evaluate $seen{$_} in a negated boolean context for the number
postfix ++ increments after returning the previous value.
so "$_ x= !$seen{$_}++" says
1) check $seen{$_} (have we seen this before)
2) then increment it (we've seen it now!)
3) negate the boolean value of $seen{$_} from before the increment
4) assign $_ to itself a number of times equal to the boolean return
(i.e., 0 or 1)
Then -p prints $_, which is either what it was before, or ''
(repetition zero times!)
Is that right?
LOL!!! That's truly, beautifully, perversely thick! >:O]
__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]