$ 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

In reply to Re^2: function prototyping & perl 5.8.20 by Tux
in thread function prototyping & perl 5.8.20 by topherv

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.