#!/usr/bin/env perl package test; sub Init { $[ = 1; } sub test { print "(\$[= $[) array has " . scalar @_ . " elements, last index = $#_\n"; } 1; #### #!/usr/bin/env perl use test; test::test(1,2,3,4); # test::Init(); test::test(1,2,3,4); #### # perl 5.8.8 output ./t1.pl ($[= 1) array has 4 elements, last index = 4 ($[= 1) array has 4 elements, last index = 4 #### # perl 5.10 $ ./t1.pl ($[= 0) array has 4 elements, last index = 3 ($[= 0) array has 4 elements, last index = 3