When you dump your array with:
use Data::Dumper;
@arr=('a','b','c');
print Dumper @arr;
you get something like this:
$VAR1 = 'a';
$VAR2 = 'b';
$VAR3 = 'c';
Is possible to get something like this:
$VAR0 = 'a';
$VAR1 = 'b';
$VAR2 = 'c';
EDIT:
So far I have end up with this one-liner:
perl -lane 'if ($_=~/VAR([0-9]+) = (.*)/) {print "VAR" . ($1-1) . "=" . $2} else {print $_}'
It works as post processing script which decrement the number after VAR. But as you can see it wont produce correct output when you have element like this:
VAR7=$VAR2->[1];
Can I somehow extend this one-liner?