xref: /openbsd-src/gnu/usr.bin/perl/win32/bin/perlglob.pl (revision c8ca900353947dc5d441eb0530d040a27377e87a)
10a5f61bbSmillert#!perl -w
20a5f61bbSmillertuse File::DosGlob;
30a5f61bbSmillert$| = 1;
40a5f61bbSmillertwhile (@ARGV) {
50a5f61bbSmillert    my $arg = shift;
60a5f61bbSmillert    my @m = File::DosGlob::doglob(1,$arg);
70a5f61bbSmillert    print (@m ? join("\0", sort @m) : $arg);
80a5f61bbSmillert    print "\0" if @ARGV;
90a5f61bbSmillert}
100a5f61bbSmillert__END__
110a5f61bbSmillert
120a5f61bbSmillert=head1 NAME
130a5f61bbSmillert
140a5f61bbSmillertperlglob.bat - a more capable perlglob.exe replacement
150a5f61bbSmillert
160a5f61bbSmillert=head1 SYNOPSIS
170a5f61bbSmillert
180a5f61bbSmillert    @perlfiles = glob  "..\\pe?l/*.p?";
190a5f61bbSmillert    print <..\\pe?l/*.p?>;
200a5f61bbSmillert
210a5f61bbSmillert    # more efficient version
220a5f61bbSmillert    > perl -MFile::DosGlob=glob -e "print <../pe?l/*.p?>"
230a5f61bbSmillert
240a5f61bbSmillert=head1 DESCRIPTION
250a5f61bbSmillert
260a5f61bbSmillertThis file is a portable replacement for perlglob.exe.  It
270a5f61bbSmillertis largely compatible with perlglob.exe (the Microsoft setargv.obj
280a5f61bbSmillertversion) in all but one respect--it understands wildcards in
290a5f61bbSmillertdirectory components.
300a5f61bbSmillert
310a5f61bbSmillertIt prints null-separated filenames to standard output.
320a5f61bbSmillert
330a5f61bbSmillertFor details of the globbing features implemented, see
340a5f61bbSmillertL<File::DosGlob>.
350a5f61bbSmillert
360a5f61bbSmillertWhile one may replace perlglob.exe with this, usage by overriding
370a5f61bbSmillertCORE::glob with File::DosGlob::glob should be much more efficient,
380a5f61bbSmillertbecause it avoids launching a separate process, and is therefore
390a5f61bbSmillertstrongly recommended.  See L<perlsub> for details of overriding
400a5f61bbSmillertbuiltins.
410a5f61bbSmillert
420a5f61bbSmillert=head1 AUTHOR
430a5f61bbSmillert
44*c8ca9003SmillertGurusamy Sarathy <gsar@activestate.com>
450a5f61bbSmillert
460a5f61bbSmillert=head1 SEE ALSO
470a5f61bbSmillert
480a5f61bbSmillertperl
490a5f61bbSmillert
500a5f61bbSmillertFile::DosGlob
510a5f61bbSmillert
520a5f61bbSmillert=cut
530a5f61bbSmillert
54