On 3/4/07, Dr.Ruud <[EMAIL PROTECTED]> wrote:
snip
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'
        };
snip

Nope, it has nothing to do with evaluation.  The trick is that it only
works on barewords (matches /[_A-Za-z][_A-Za-z0-9]*/). 0b1_0 is not a
bareword because it starts with a number.  The same goes for 01_0,
0x1_0, and 1_0. _1_0 works because barewords may start with an
underscore. *_ and \_ are definitely not a barewords since they
contain characters that are not even in the allowed set.  Anything
that fails the bareword test is treated as if the '=>' operator were a
normal ',' operator.

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


Reply via email to