#!/usr/bin/perl -w # Get first argument. $arg = shift(@ARGV); # Loop while there is an argument. while (defined $arg) { print "$arg\n"; # Get next argument. $arg = shift(@ARGV); }