"John W. Krahn" schreef:
> Chas Owens:

>> In Perl 5 the only difference between the '=>' and ',' operators is
>> that the '=>' operator treats the word on the left like a string.
>> The '=>' is preferred when working with hashes because it provides a
>> visual cue that you are not dealing with a normal list.
>
> The key word there is "word".  The => operator only works with "word"
> characters (a-z, A-Z, 0-9 and _).

Some evaluation is done first:

perl -Mstrict -MData::Dumper -wle'
  $_ = {0b1_0 => "A", 01_0 => "B", 0x1_0 => "C", 1_0 => "D", _1_0 =>
"E", *_ => "F", \_ => "G"};
  print Dumper $_
'
$VAR1 = {
          '8' => 'B',
          '_1_0' => 'E',
          '*main::_' => 'F',
          '10' => 'D',
          '16' => 'C',
          'SCALAR(0x8062850)' => 'G',
          '2' => 'A'
        };

-- 
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