in reply to Re^2: The maybe it is better written this way tool
in thread The maybe it is better written this way tool

I think Anonymous Monk make hints about $[

$[ = 10; my @arr = ('a', 'b'); use Data::Dumper; warn Dumper [ $#arr, scalar @arr ]; __END__ $VAR1 = [ '11', 2 ];

Actually I think it would be better if this tool will suggest not to change $[ in the first place.

Replies are listed 'Best First'.
Re^4: The maybe it is better written this way tool
by ikegami (Patriarch) on Nov 14, 2009 at 22:18 UTC

    So you'rehe's saying I shouldn't do the following?

    for my $i (0..$#array) { ... }

    No. The proper answer is not to avoid $#array, it's to avoid $[.

    $[ has long been discouraged, it is deprecated in 5.12, and it will be removed for 5.14.