Charles K. Clarkson [CKC], on Monday, November 15, 2004 at 09:20
(-0600) typed:

CKC> :     $seen{$item} ? $seen{$item}++ : $seen{$item} = 1; }
CKC>     $seen{$item} = $seen{$item} ? ++$seen{$item} : 1;

ok I understand, but I don't know why my line doesn't work. I thought
(exp) ? (true) : (false) is the same as if (exp) {  } else { }

CKC> chomp @list;
CKC> foreach my $item (@list) {
CKC>     $seen{ $item }++;
CKC> }

very nice, thanks.

-- 

 ...m8s, cu l8r, Brano.

[Louisiana: It is against the law to gargle in public.]



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to