At 05:16 PM 5/10/00, Jimmy S. Lim wrote:
>can someone help a newbie understand what ($i{$_} ++) means below? Thanks!
>
>while (<IN>) {unless ($i{$_} ++)  {push (@Unique, $_)}}

1. It means you need a new Perl coder who isn't so full of himself.  <grin>

2: I assume you know while(<IN>) says read a line and put it in $_ and 
execute the loop.

there is a hash %i

$i{$_} is a item in that hash

the ++ says increment it

However, since the ++ is after the symbol it says return zero if it doesn't 
exist.

If zero (unless), create an array @Unique that contains all the keys.

Seems like the "keys" verb could have done this better, but since I don't 
see how @Unique is used this might be too harsh.

You either need to fire this dude or let him go work with Larry Wall.  <grin>

Frank


---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
         [EMAIL PROTECTED]
For non-automated Mailing List support, send email to  
         [EMAIL PROTECTED]

Reply via email to