in reply to Perl 6 and Perl 5 parsing
Perl5's grammar is mutable too.
$ perl -E'sub f() { 0 } say f + 1;' 1 $ perl -E'sub f($) { 0 } say f + 1;' 0
$ perl -E'sub f { say $_[0]; } f { foo => "bar" };' HASH(0x816c158) $ perl -E'sub f(&) { say $_[0]; } f { foo => "bar" };' CODE(0x817bc80)
$ perl -E' $x = foo; say $x; sub foo { "sub" }' foo $ perl -E'sub foo; $x = foo; say $x; sub foo { "sub" }' sub
Update: Added an example to show that prototypes aren't the only source.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Perl 6 and Perl 5 parsing
by TimToady (Parson) on Jan 14, 2011 at 21:01 UTC |
In Section
Seekers of Perl Wisdom