The expression in the curlies should evaluate to a reference (or variable name when strictures are off). You were relying on a case where this was broken. Looks like the bug was fixed in 5.10.0:
>perl589\bin\perl -le"@8 = 0..5; @a = 0..7; print $#{ @a }" 7 >perl5100\bin\perl -le"@8 = 0..5; @a = 0..7; print $#{ @a }" 5
See Dereferencing Syntax and References Quick Reference
was coming back as -1.
Only because you disabled strictures. (boooo!)
>perl -wle"no strict; my @a = qw( a b c ); print $#{ @a }" -1 >perl -wle"use strict; my @a = qw( a b c ); print $#{ @a }" Can't use string ("3") as an ARRAY ref while "strict refs" in use at - +e line 1.
Update: Added examples.
In reply to Re: Something changed in how to refer to length of hash of arrays?
by ikegami
in thread Something changed in how to refer to length of hash of arrays?
by punch_card_don
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |