use strict; use warnings; my @outer = (qw| one two three |); print "First\n"; foreach my $o (@outer) { print $o, "\n"; } print "Second\n"; foreach my $o (@outer) { $o .= 'HIII'; print $o, "\n"; } print "ARRAY " , @outer , "\n"; #print $o, "\n"; # Comment out compile time error print "Third\n"; foreach my $o (@outer) { print $o, "\n"; } #### First one two three Second oneHIII twoHIII threeHIII ARRAY oneHIIItwoHIIIthreeHIII Third oneHIII twoHIII threeHIII #### foreach my $o (@outer) { $o .= 'HIII'; print $o, "\n"; }