or, even simpler...my($scalar, @restofarray) = @array;
and @array will contain the remainder.my $scalar = shift(@array);
disclaimer: ignoring differences between arrays and lists for the sake of simplicity
Remember rule one...
In reply to Re: head of list + rest of list
by Forsaken
in thread head of list + rest of list
by jjohhn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |