in reply to Re: Using 'Shift' in subroutine argument
in thread Using 'Shift' in subroutine argument
you would getuse strict; use warnings; one(1,2,3,4); sub one{ &two (shift, shift); } sub two { print "Elements : \n @_ \n"; }
Which means that it's same as passing the first two elements of the list the sub-routine one has received.Though I was not able to compile the codeElements : 1 2
which is your case.Provide the some context of your snippet that would help everyone to learn.sub one{ &two shift, shift; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Using 'Shift' in subroutine argument
by shmem (Chancellor) on Nov 02, 2007 at 13:20 UTC |