As an unintended side effect of creating $ 1, $ 2, $ 3, $ 100, etc. (to store the results of capturing regular expressions); @ 1, @ 2, @ 3, @ 100, etc. Also created.
However, the names of these and most special vars in perlvar are not legal names other than vars packages. For example, you cannot do my $(; or sub (; , although though $( is a valid name for the package variable [1] .
When vocabulary was added to Perl in 5.6, it was considered confusing to allow such names for user variables. In fact, I doubt that someone even entertained this thought.
Sigil aside, lexical vars must begin with a character in [a-zA-Z_] [2] and can be followed by several characters in [a-zA-Z0-9_] [2] . Thus, @100 not a valid name for a lexical variable.
Notes:
>perl -e"our $(;" >perl -e"my $(;" Can't use global $( in "my" at -e line 1, near "my $(" Execution of -e aborted due to compilation errors. >perl -e"sub (;" Prototype not terminated at -e line 1.
More code points are actually allowed, but they go beyond the ASCII character set. For simplicity, I have listed only code points that fall within the ASCII character set.
source share