in reply to shift operator
In a subroutine @_ is a list of the arguments to the call. For example...
mysub(1, 2, 3); sub mysub { print "@_\n"; my $x = shift; print "@_\n"; print "$x\n"; } #Outputs: #1 2 3 #2 3 #1
shift within a subroutine grabs the first argument to the call. So in the example above, 1 will be removed from @_ and assigned to $x.
|
|---|