Front page | perl.perl5.porters |
Postings from July 2011
July 19, 2011 13:49
Message ID: 20110719204917.GQ16369@lake.fysh.org
Just spotted this in perldelta:
The C<prototype> function now returns a prototype (the empty string) for
the C<__FILE__>, C<__LINE__> and C<__PACKAGE__> directives, instead of
dying, as they are indistinguishable syntactically from nullary functions
$ perl -lwe 'print time()'
$ perl -lwe 'print __FILE__()'
syntax error at -e line 1, near "__FILE__("
Execution of -e aborted due to compilation errors.
I'm all for treating them as nullary functions, but that's not currently
what they look like. I think we can readily resolve this by allowing
empty parens after __FILE__ et al; as shown here, it's currently a syntax
error, so it won't break anything. (But tread carefully when editing
this stuff. It is subtle and quick to anger.)