Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I handle wildcards on the command line using Perl on Windows?

I though this would be simple, but apparently I can't do:

script.pl *.ext

in the WinXP command processor.

Is there a built-in solution? (i.e. not a CPAN module?)

like image 428
chris Avatar asked Jan 24 '23 10:01

chris


1 Answers

File::DosGlob is a core module:

#!/usr/bin/perl

use strict;
use warnings;

use File::DosGlob qw( glob );
print map { "$_\n"} map { glob } @ARGV;
__END__
    C:\Temp> tgh *.pl
    ...
    tgh.pl
    tgm.pl
    thg.pl
    thk.pl
    tjl.pl
    tjm.pl
    tkj.pl
    tkl.pl
like image 129
Sinan Ünür Avatar answered Jan 29 '23 23:01

Sinan Ünür