in reply to What does the SHIFT bit do in a constructor

Well that looks like a line you seen in alot of subroutines eg
sub do_something { my $classname = shift; .... } do_somthing($something);
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 $classname

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
    Sorry, I just spotted that you mentioned "in a constructor", well it's a similar idea. The guys above have explained it well.

    Diarmuid