in reply to Re: function prototyping & perl 5.8.20
in thread function prototyping & perl 5.8.20

$ perl5.12.5 -we'for my $k qw(a b) {$_=$k}' $ perl5.14.0 -we'for my $k qw(a b) {$_=$k}' Use of qw(...) as parentheses is deprecated at -e line 1. $ perl5.16.3 -we'for my $k qw(a b) {$_=$k}' Use of qw(...) as parentheses is deprecated at -e line 1. $ $ perl5.18.0 -we'for my $k qw(a b) {$_=$k}' syntax error at -e line 1, near "$k qw(a b)" Execution of -e aborted due to compilation errors.

If you upgrade, you might as well read the release notes. Oké, if you take big steps, there are a lot of changes to read, but all of this is documented.

See the 5.14.0 delta entry:

=head2 Use of qw(...) as parentheses Historically the parser fooled itself into thinking that C<qw(...)> li +terals were always enclosed in parentheses, and as a result you could sometim +es omit parentheses around them: for $x qw(a b c) { ... } The parser no longer lies to itself in this way. Wrap the list litera +l in parentheses like this: for $x (qw(a b c)) { ... } This is being deprecated because the parentheses in C<for $i (1,2,3) { + ... }> are not part of expression syntax. They are part of the statement syntax, with the C<for> statement wanting literal parentheses. The synthetic parentheses that a C<qw> expression acquired were only intended to be treated as part of expression syntax. Note that this does not change the behaviour of cases like: use POSIX qw(setlocale localeconv); our @EXPORT = qw(foo bar baz); where parentheses were never required around the expression.

And the 5.18.0 delta entry:

=head2 qw(...) can no longer be used as parentheses C<qw> lists used to fool the parser into thinking they were always surrounded by parentheses. This permitted some surprising constructio +ns such as C<foreach $x qw(a b c) {...}>, which should really be written C<foreach $x (qw(a b c)) {...}>. These would sometimes get the lexer +into the wrong state, so they didn't fully work, and the similar C<foreach +qw(a b c) {...}> that one might expect to be permitted never worked at all. This side effect of C<qw> has now been abolished. It has been depreca +ted since Perl v5.13.11. It is now necessary to use real parentheses everywhere that the grammar calls for them.

Which makes me think you made a move from perl-5.10.1 to perl-5.18.0 or newer. As you state 5.8.20 (which never existed), I assume you mean 5.28.0.


Enjoy, Have FUN! H.Merijn