"John W. Krahn" schreef:

> my %hash;
> 
> @hash{ @array } = ();


Example:

$ perl -MData::Dumper -wle '
    my @array = qw/x t 3 u 77 y r/;
    my %hash;
    @hash{ @array } = ();
    print Dumper(\%hash);

'
$VAR1 = {
          'y' => undef,
          'u' => undef,
          'r' => undef,
          '77' => undef,
          '3' => undef,
          'x' => undef,
          't' => undef
        };

-- 
Affijn, Ruud

"Gewoon is een tijger."

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


Reply via email to