in reply to What does the SHIFT bit do in a constructor
All it does is take the first element off the array @_ (which in this case contains the elements of the array passed to the subroutine) and puts that value into $classnamesub do_something { my $classname = shift; .... } do_somthing($something);
From the perldoc
See also `unshift', `push', and `pop'. `Shift()' and `unshift' do the same thing to the left end of an array that `pop' and `push' do to the right end.
Diarmuid
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: What does the SHIFT bit do in a constructor
by diarmuid (Beadle) on May 25, 2001 at 16:54 UTC |