I am trying to adapt to Active Perl on the DOS command line from cygwin.
I've tried to get File:DosGlob to work on my system (this script works
on a co-worker's system, but not mine), but does not work as expected.

 

When I run the script fileglob.pl, @ARGV seems to get lost.

 

Code:

#! /usr/bin/perl 

 

if ( $^O == "MSWin32" )

{

      use File::DosGlob;

      @ARGV = map {

            my @g = File::DosGlob::glob($_) if /[*?]/;

            @g ? @g : $_;

      } @ARGV;

}

 

print "foo\n";

 

foreach $filename (@ARGV)

{

      print "$filename\n";

}

 

Run as fileglob.pl:

 

C:\Unix\dev>fileglob.pl *.pl

foo

 

Put perl in front of it and it works as expected:

C:\Unix\dev>perl fileglob.pl *.pl

foo

cycleSelect.pl

fileglob.pl

foo.pl

get_permissions.pl

if.pl

ioscan.pl

OLE.pl

regexp.pl

splat.pl

 

Why won't the first call work?

 

Here's my environment settings:

 

C:\Unix\dev>perl fileglob.pl *.pl

foo

cycleSelect.pl

fileglob.pl

foo.pl

get_permissions.pl

if.pl

ioscan.pl

OLE.pl

regexp.pl

splat.pl

 

C:\Unix\dev>assoc .pl

.pl=PerlScript

 

C:\Unix\dev>ftype PerlScript

PerlScript="C:\Program Files\Perl\bin\perl.exe" %1 %*

 

Thanks,

Steve 

 

 

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to