# your above script will work with this invocation: perlscript one two #### #!/usr/bin/perl -n use strict; use warnings; my @words = split; # "split /\s+/, $_", more or less print "passed $_\n" for @words;