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"; #### pritesh@t430:~$ perl test.pl Before calling the sub test_this @arr: 1 2 3 4 5 6 7 8 9 10 Inside the sub, before the map @arr: 1 2 3 4 5 6 7 8 9 10 Inside the sub, before the map @_ = 1 2 3 4 5 6 7 8 9 10 Inside the sub, after the map @arr: 2 4 6 8 10 12 14 16 18 20 Inside the sub, after the map @_ = 2 4 6 8 10 12 14 16 18 20 After calling the sub test_this @arr: 2 4 6 8 10 12 14 16 18 20 pritesh@t430:~$