Problems? Is your data what you think it is? | |
PerlMonks |
Re: Why doesn't "my ($x) = @);" generate a syntax error?by tobyink (Canon) |
on Jun 13, 2013 at 06:50 UTC ( [id://1038686]=note: print w/replies, xml ) | Need Help?? |
For any punctuation character x, if there is a magic variable called $x, then there must also be magic variables called @x and %x. That's an artefact of how current versions of the Perl parser work. So because the $) exists and does something useful, the @) variable must also exist (even if it does nothing useful!)
package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name
In Section
Seekers of Perl Wisdom
|
|