This probably does deserve a better warning but you can find this behaviour documented in the Technical Note on the Syntax of Variable Names
section in perlvar
, where it is noted that ...
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. A few other names are also exempt in these ways: