sub inc { $_[0]++ } my ($i,$j) = (0,0); inc(@{[$i]}); inc($j); print"$i $j\n";' =output 0 1