use English; sub doesntchangefirst1{my $first = $ARG[0]; $first = 99;} # The following causes a compiler error: sub doesntchangefirst2{my $first = shift @ARG; $first = 99;} # The one above should be like this: sub doesntchangefirst3{my $first = shift @ARG; $first = 99;} sub doesntchangefirst4{my $first = shift ; $first = 99;} @a = (1,2,3,4); print @a, "\n"; doesntchangefirst1 @a; print @a, "\n"; doesntchangefirst2 @a;print @a, "\n"; doesntchangefirst3 @a;print @a, "\n"; doesntchangefirst4 @a;print @a, "\n"; $i = shift @a; print $i, "\n"; print @a, "\n"; sub returnFirstTwoRev{ my ($first, $second) = @ARG; return ($second, $first); } @a = (11..15); @l = returnFirstTwoRev @a; # Prints 21 print join (",", @l), "\n"; $x = returnFirstTwoRev @a; # Prints 21 print $x;