_brian_d_foy wrote:

my %hash = map { $_, 1 } @array;

Possibly more idiomatic would be

     my %hash   = map { $_ => 1 } @array;

   # or a hash slice: @hash{ @array } = ();
   # or a foreach: $hash{$_} foreach ( @array );

That last should be

    $hash{$_} = 1 foreach @array;

maybe?  As it is, it doesn't create the hash elements.

The first time the loop
sees an element, that element has no key in C<%Seen>.

Why the capital "S"? None of the other variables are capitalized, and it's not standard Perl practice.


--
Keith C. Ivey <[EMAIL PROTECTED]>
Washington, DC

Reply via email to