sub test { my $next = shift; # get and remove first item from @_ print $next."\n"; my @neu = @_; foreach my $x (@neu) { print $x."\n"; } }