"John W. Krahn" wrote: > > David Eason wrote: > > > > Is there a better way to say: > > > > my @input_files = glob (join " ", @ARGV) unless $#ARGV = -1; > > foreach my $doc ( @input_files ) { ... __code goes here___ } > > > > I put the unless clause in there because otherwise... > > if there are no file arguments, @input_files ends up having an element [0] > > And the foreach loop tries to run anyway. > > That will break if there are any file names with whitespace in them.
Disrequard my previous post. :-) You will have to escape the whitespace like this: my @input_files = map glob, map { s/(\s)/\\$1/g; $_ } @ARGV; John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]