in reply to Re: head of list + rest of list
in thread head of list + rest of list
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();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: head of list + rest of list
by merlyn (Sage) on May 18, 2005 at 18:30 UTC | |
|
Re^3: head of list + rest of list
by lkundrak (Novice) on Jul 14, 2014 at 08:53 UTC |