Update:Package ArraySeperator; sub new { my ( $class, @rest ) = @_; my $self = [@rest]; bless $self, $class; return $self; } sub head { my $self = shift; return $self->[0]; } sub rest { my $self = shift; my $size = scalar @$self; return @$self->[ 1 .. $size ]; } Package main; my $head; my @rest; my $seperator = ArraySeperator->new( @list ); $head = $seperator->head(); @rest = $seperator->rest();
In reply to Re^2: head of list + rest of list
by mrborisguy
in thread head of list + rest of list
by jjohhn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |