note
ikegami
Perl5's grammar is mutable too.
<c>
$ perl -E'sub f() { 0 } say f + 1;'
1
$ perl -E'sub f($) { 0 } say f + 1;'
0
</c>
<c>
$ perl -E'sub f { say $_[0]; } f { foo => "bar" };'
HASH(0x816c158)
$ perl -E'sub f(&) { say $_[0]; } f { foo => "bar" };'
CODE(0x817bc80)
</c>
<c>
$ perl -E' $x = foo; say $x; sub foo { "sub" }'
foo
$ perl -E'sub foo; $x = foo; say $x; sub foo { "sub" }'
sub
</c>
<p><b>Update</b>: Added an example to show that prototypes aren't the only source.
882311
882311