Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Numbers for array names run silent with strictures

Tags:

perl

Why are array names with numbers treated like predefined globals?

perl -Mstrict -wle '@2014 = 3..6; print "@2014"'

(no warnings here)

like image 632
mpapec Avatar asked Oct 17 '13 12:10

mpapec


1 Answers

From perlvar:

Perl identifiers that begin with digits, control characters, or punctuation characters are exempt from the effects of the package declaration and are always forced to be in package main ; they are also exempt from strict 'vars' errors.

like image 99
toolic Avatar answered Oct 04 '22 14:10

toolic