printf "Got %s!\n", shift while @ARGV; #### use subs qw(printfor); printfor @ARGV; sub printfor { my $f = shift; printf "Got %s!\n", shift while @_; }