win32/TEST Win32 port
win32/autosplit.pl Win32 port
win32/bin/network.pl Win32 port
+win32/bin/perlglob.pl glob() support
win32/bin/pl2bat.pl wrap perl scripts into batch files
win32/bin/runperl.pl run perl script via batch file namesake
win32/bin/search.pl Win32 port
perlglob.exe relies on the argv expansion done by the C Runtime of
the particular compiler you used, and therefore behaves very
differently depending on the Runtime used to build it. To preserve
-compatiblity, perlglob.bat (a perl script/module that can be
-used portably) is installed. Besides being portable, perlglob.bat
-also offers enhanced globbing functionality.
+compatiblity, perlglob.bat (a perl script that can be used portably)
+is installed. Besides being portable, perlglob.bat also offers
+enhanced globbing functionality.
If you want perl to use perlglob.bat instead of perlglob.exe, just
delete perlglob.exe from the install location (or move it somewhere
-perl cannot find). Using File::DosGlob.pm (which is the same
-as perlglob.bat) to override the internal CORE::glob() works about 10
-times faster than spawing perlglob.exe, and you should take this
-approach when writing new modules. See File::DosGlob for details.
+perl cannot find). Using File::DosGlob.pm (which implements the core
+functionality of perlglob.bat) to override the internal CORE::glob()
+works about 10 times faster than spawing perlglob.exe, and you should
+take this approach when writing new modules. See File::DosGlob for
+details.
=item Using perl from the command line
package File::DosGlob;
-unless (caller) {
- $| = 1;
- while (@ARGV) {
- #
- # We have to do this one by one for compatibility reasons.
- # If an arg doesn't match anything, we are supposed to return
- # the original arg. I know, it stinks, eh?
- #
- my $arg = shift;
- my @m = doglob(1,$arg);
- print (@m ? join("\0", sort @m) : $arg);
- print "\0" if @ARGV;
- }
-}
-
sub doglob {
my $cond = shift;
my @retval = ();
File::DosGlob - DOS like globbing and then some
-perlglob.bat - a more capable perlglob.exe replacement
-
=head1 SYNOPSIS
require 5.004;
# from the command line (overrides only in main::)
> perl -MFile::DosGlob=glob -e "print <../pe*/*p?>"
-
- > perlglob ../pe*/*p?
=head1 DESCRIPTION
A module that implements DOS-like globbing with a few enhancements.
-This file is also a portable replacement for perlglob.exe. It
-is largely compatible with perlglob.exe (the M$ setargv.obj
+It is largely compatible with perlglob.exe (the M$ setargv.obj
version) in all but one respect--it understands wildcards in
directory components.
You may have to double the backslashes if you are putting them in
literally, due to double-quotish parsing of the pattern by perl.
-When invoked as a program, it will print null-separated filenames
-to standard output.
-
-While one may replace perlglob.exe with this, usage by overriding
-CORE::glob via importation should be much more efficient, because
-it avoids launching a separate process, and is therefore strongly
-recommended. Note that it is currently possible to override
-builtins like glob() only on a per-package basis, not "globally".
-Thus, every namespace that wants to override glob() must explicitly
-request the override. See L<perlsub>.
-
Extending it to csh patterns is left as an exercise to the reader.
=head1 EXPORTS (by request only)
perl
+perlglob.bat
+
=cut
#
all: $(PERLEXE) $(PERL95EXE) $(GLOBEXE) $(DYNALOADMODULES) $(MINIMOD) \
- $(X2P) $(GLOBBAT)
+ $(X2P)
$(DYNALOADER)$(o) : $(DYNALOADER).c $(CORE_H) $(EXTDIR)\DynaLoader\dlutils.c
$(LINK32) $(LINK_FLAGS) $(LIBFILES) -out:$@ -subsystem:$(SUBSYS) \
perlglob$(o) setargv$(o)
-$(GLOBBAT) : ..\lib\File\DosGlob.pm $(MINIPERL)
- $(MINIPERL) $(PL2BAT) - < ..\lib\File\DosGlob.pm > $(GLOBBAT)
-
perlglob$(o) : perlglob.c
..\miniperlmain$(o) : ..\miniperlmain.c $(CORE_H)
$(XCOPY) *.bat ..\win32\bin\*.*
cd ..\win32
$(PERLEXE) $(PL2BAT) bin\network.pl bin\www.pl bin\runperl.pl \
- bin\pl2bat.pl
+ bin\pl2bat.pl bin\perlglob.pl
distclean: clean
-del /f $(MINIPERL) $(PERLEXE) $(PERL95EXE) $(PERLDLL) $(GLOBEXE) \
$(MINIPERL) -I..\lib ..\splittree.pl "../LIB" "../LIB/auto"
$(RCOPY) ..\lib $(INST_LIB)\*.*
-minitest : $(MINIPERL) $(GLOBEXE) $(CONFIGPM)
+minitest : $(MINIPERL) $(GLOBEXE) $(CONFIGPM) utils
$(XCOPY) $(MINIPERL) ..\t\perl.exe
$(XCOPY) $(GLOBEXE) ..\t\$(NULL)
attrib -r ..\t\*.*
$(MINIPERL) -I..\lib test base/*.t comp/*.t cmd/*.t io/*.t op/*.t pragma/*.t
cd ..\win32
-test-prep : all
+test-prep : all utils
$(XCOPY) $(PERLEXE) ..\t\$(NULL)
$(XCOPY) $(PERLDLL) ..\t\$(NULL)
$(XCOPY) $(GLOBEXE) ..\t\$(NULL)
--- /dev/null
+#!perl -w
+use File::DosGlob;
+$| = 1;
+while (@ARGV) {
+ my $arg = shift;
+ my @m = File::DosGlob::doglob(1,$arg);
+ print (@m ? join("\0", sort @m) : $arg);
+ print "\0" if @ARGV;
+}
+__END__
+
+=head1 NAME
+
+perlglob.bat - a more capable perlglob.exe replacement
+
+=head1 SYNOPSIS
+
+ @perlfiles = glob "..\\pe?l/*.p?";
+ print <..\\pe?l/*.p?>;
+
+ # more efficient version
+ > perl -MFile::DosGlob=glob -e "print <../pe?l/*.p?>"
+
+=head1 DESCRIPTION
+
+This file is a portable replacement for perlglob.exe. It
+is largely compatible with perlglob.exe (the Microsoft setargv.obj
+version) in all but one respect--it understands wildcards in
+directory components.
+
+It prints null-separated filenames to standard output.
+
+For details of the globbing features implemented, see
+L<File::DosGlob>.
+
+While one may replace perlglob.exe with this, usage by overriding
+CORE::glob with File::DosGlob::glob should be much more efficient,
+because it avoids launching a separate process, and is therefore
+strongly recommended. See L<perlsub> for details of overriding
+builtins.
+
+=head1 AUTHOR
+
+Gurusamy Sarathy <gsar@umich.edu>
+
+=head1 SEE ALSO
+
+perl
+
+File::DosGlob
+
+=cut
+
#
all: $(PERLEXE) $(PERL95EXE) $(GLOBEXE) $(DYNALOADMODULES) $(MINIMOD) \
- $(X2P) $(GLOBBAT)
+ $(X2P)
$(DYNALOADER)$(o) : $(DYNALOADER).c $(CORE_H) $(EXTDIR)\DynaLoader\dlutils.c
perlglob$(o) setargv$(o)
.ENDIF
-$(GLOBBAT) : ..\lib\File\DosGlob.pm $(MINIPERL)
- $(MINIPERL) $(PL2BAT) - < ..\lib\File\DosGlob.pm > $(GLOBBAT)
-
perlglob$(o) : perlglob.c
..\miniperlmain$(o) : ..\miniperlmain.c $(CORE_H)
pl2pm c2ph h2xs perldoc pstruct
$(XCOPY) ..\utils\*.bat bin\*.*
$(PERLEXE) -I..\lib $(PL2BAT) bin\network.pl bin\www.pl bin\runperl.pl \
- bin\pl2bat.pl
+ bin\pl2bat.pl bin\perlglob.pl
distclean: clean
-del /f $(MINIPERL) $(PERLEXE) $(PERL95EXE) $(PERLDLL) $(GLOBEXE) \
$(MINIPERL) -I..\lib ..\splittree.pl "../LIB" "../LIB/auto"
$(RCOPY) ..\lib $(INST_LIB)\*.*
-minitest : $(MINIPERL) $(GLOBEXE) $(CONFIGPM)
+minitest : $(MINIPERL) $(GLOBEXE) $(CONFIGPM) utils
$(XCOPY) $(MINIPERL) ..\t\perl.exe
.IF "$(CCTYPE)" == "BORLAND"
$(XCOPY) $(GLOBBAT) ..\t\$(NULL)
cd ..\t && \
$(MINIPERL) -I..\lib test base/*.t comp/*.t cmd/*.t io/*.t op/*.t pragma/*.t
-test-prep : all
+test-prep : all utils
$(XCOPY) $(PERLEXE) ..\t\$(NULL)
$(XCOPY) $(PERLDLL) ..\t\$(NULL)
.IF "$(CCTYPE)" == "BORLAND"