in reply to Why doesn't "my ($x) = @);" generate a syntax error?
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
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Why doesn't "my ($x) = @);" generate a syntax error?
by Grimy (Pilgrim) on Jun 13, 2013 at 17:57 UTC | |
by tobyink (Canon) on Jun 13, 2013 at 23:31 UTC | |
Re^2: Why doesn't "my ($x) = @);" generate a syntax error?
by zork42 (Monk) on Jun 13, 2013 at 06:57 UTC |
In Section
Seekers of Perl Wisdom