perlglob.pl

来自「UNIX下perl实现代码」· PL 代码 · 共 54 行

PL
54
字号
#!perl -wuse 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 NAMEperlglob.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 DESCRIPTIONThis file is a portable replacement for perlglob.exe.  Itis largely compatible with perlglob.exe (the Microsoft setargv.objversion) in all but one respect--it understands wildcards indirectory components.It prints null-separated filenames to standard output.For details of the globbing features implemented, seeL<File::DosGlob>.While one may replace perlglob.exe with this, usage by overridingCORE::glob with File::DosGlob::glob should be much more efficient,because it avoids launching a separate process, and is thereforestrongly recommended.  See L<perlsub> for details of overridingbuiltins.=head1 AUTHORGurusamy Sarathy <gsar@activestate.com>=head1 SEE ALSOperlFile::DosGlob=cut

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?