http://qs1969.pair.com?node_id=882394


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.