in reply to Re: "strict" violation on "sort" command with perl 5.10
in thread "strict" violation on "sort" command with perl 5.10

Or $refdataarr holds 13 instead of an array ref.

Either way, it usually happens when one does
$ref = @array;
when one needs to do
$ref = \@array;
or
$ref = [ @array ];

Contrary to what the OP said, it has nothing to do with 5.10. Something else changed too.

Replies are listed 'Best First'.
Re^3: "strict" violation on "sort" command with perl 5.10
by AnomalousMonk (Archbishop) on Apr 28, 2009 at 22:36 UTC
    From the OP:
    ${@$a}[0]
    I had to stare at that for a bit and then do a little experiment:
    >perl -wMstrict -le "my @ra = qw(a b c d); my $ar = \@ra; print ${ ra}[2]; print ${ @ra}[2]; print ${ $ar}[2]; print ${@$ar}[2]; " c c c c
    Sure enough, it works! I'm gobsmacked!

    Needless to say, I've never seen the second and fourth forms of the array access expression, the ones using the  @ sigil apparently redundantly. These forms are certainly not widely used, but are they ever used? I.e., is there any situation in which the  @ sigil must be used in this way?

    Update: Added $ that was MIA in ${@$a}[0].

      There are no reasons to use it, and one shouldn't use it.