sub head { my ($n,@list)=@_; $n ? ($list[0],head($n-1,butfirst(@list))) : () } sub butfirst { shift; @_ }