Sorry to drag this one up again, but it doesn't seem to have been answered
properly. Surely the answer is:
my @input_files = map glob, @ARGV;
which will also leave @input_files empty if @ARGV is empty.
Cheers all,
Rob
"David Eason" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> 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.
>
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]