in reply to Re^9: Perl list items
in thread Perl list items

I'm still puzzled by the absence of a "... better written as ..." warning.

Because the code is different :) Because @warnme... is different from @$derefNowarn...

For verbosity see diagnostics, try  perl -Mdiagnostics -e " @ARGV[0] "

Replies are listed 'Best First'.
Re^11: Perl list items
by AnomalousMonk (Archbishop) on Jul 10, 2012 at 10:36 UTC
    Because the code is different :)

    True, the code is different, but the expressions are all equivalent: they're all 'degenerate' single-item slices.

    Because @warnme... is different from @$derefNowarn...

    I don't understand the significance of this statement. Are scalar derefs in this context (single-item slices) simply not warned about? If so, is there a rationale for this? (I could understand if this was simply beyond the scope of the warnings system as it now stands. After all, you can't warn about everything.)

    For verbosity see diagnostics...

    diagnostics are indeed more verbose, but don't throw more light, for me, on this (admittedly somewhat trivial) problem. Oh well, going to bed now...