From: Bryan Harris <[EMAIL PROTECTED]>
> >> I'm sure this has been answered before, but I can't seem to find an
> >> answer.
> >>
> >> Windows doesn't seem to want to expand wildcards before passing
> >> arguments to my script. For example, typing:
> >>
> >> fixNCcode P*
> >>
> >> Passes 'P*' to my script instead of all files that start with "P".
> >>
> >> Is there a workaround? How is this generally done?
> >
> > You have to use the glob function:
> >
> > my @files = glob $ARGV[0];
>
>
> Thanks John and Jenda.
>
> This works for Windows, but does it break the script for use on Unix?
> Is there a check to see if the script is running on Windows before I
> do the glob?
The G.pm was made so that it's a NOOP (NO OPeration) under anything
but windows. You may want to make sure it will not be even loaded by
BEGIN {
if ($^O eq 'MSWin32') {
eval "use G;";
}
}
If course it's up to you whether you have
eval "use G;";
or some glob() based code there :-)
Jenda
===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]