[Melbourne-pm] $a $b $c

Joshua Goodall joshua at roughtrade.net
Fri Aug 13 08:28:06 CDT 2004


Slightly amused by:

[529] joshua at green:~$ perl -le 'use strict; $a = 42;'
[529] joshua at green:~$ perl -le 'use strict; $b = 101;'
[530] joshua at green:~$ perl -le 'use strict; $c = 3.141;'
Global symbol "$c" requires explicit package name at -e line 1.
Execution of -e aborted due to compilation errors.

This probably has something to do with sort BLOCK, doesn't it?
perlfunc -f sort alludes to $a / $b being package variables,
but I'd always assumed it was black magic for 'sort BLOCK' only.

There appears to be an implied our($a, $b) at the start of each
scope.  This tripped me up today because -w / use strict didn't
catch a typo I'd made.

Briefly tested with 5.8.5 only.

J


-- 
Joshua Goodall                           "as modern as tomorrow afternoon"
joshua at roughtrade.net                                       - FW109


More information about the Melbourne-pm mailing list