use strict; use warnings; my @arr = (1..10); sub test_this { print "Inside the sub, before the map \@arr: @arr\n"; print "Inside the sub, before the map \@\_ = @_\n"; @arr = map { 2 * $_ } @_; print "Inside the sub, after the map \@arr: @arr\n"; print "Inside the sub, after the map \@\_ = @_\n"; } print "Before calling the sub test_this \@arr: @arr\n"; &test_this(@arr); print "After calling the sub test_this \@arr: @arr\n";