/\* how are we supposed to declare the size of variables again? */; my $head; /\* scalar (could be number OR string) */; my @tail; /\* array of scalars (could be numbers or strings, and grows + dynamically) */; $head = $list[0]; /\* why isn't this @list[0] ? */; for (my $i = 1; $i <= $#list; $i++) { $tail[$i - 1] = $list[$i]; }
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
In reply to Re^2: head of list + rest of list
by merlyn
in thread head of list + rest of list
by jjohhn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |