Ned Konz wrote
> > I need to process several files passing a wildcard filename  as
> arguments as
> > in:
> >
> > perl p1.pl *.txt
>
> It depends on what you're doing.
>
> the glob() function will return a list of matching files (but may call
> an external shell or glob program to do so).
>
>       my @files = glob('*.txt');
>       foreach my $file (@files) { ... }

It might be worth pointing out (in case you see examples elsewhere) that on
UNIX/etc. the '*.txt' is expanded by the command interpreter (or "shell")
BEFORE it is passed to the perl script. On such platforms you do not need
the glob (same applies for cygwin if you are using win32 bash as a shell).

Of course to make the code cross platform you should always use glob.

Zoltan.


---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
         [EMAIL PROTECTED]
For non-automated Mailing List support, send email to  
         [EMAIL PROTECTED]

Reply via email to