[Melbourne-pm] $a $b $c
joshua at roughtrade.net
Fri Aug 13 08:28:06 CDT 2004
Slightly amused by:
 joshua at green:~$ perl -le 'use strict; $a = 42;'
 joshua at green:~$ perl -le 'use strict; $b = 101;'
 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.
Joshua Goodall "as modern as tomorrow afternoon"
joshua at roughtrade.net - FW109
More information about the Melbourne-pm