use Data::Dumper; @arr = (1,2,3); print Dumper(\@arr); foreach $i (@arr) { # not doing or changing anything here. } print Dumper(\@arr);