Win32::Wildcard - Unfold the wildcards contained in @ARGV automatically |
Win32::Wildcard - Unfold the wildcards contained in @ARGV automatically
# In your script: # foo.pl use Win32::Wildcard 'unfold';
unfold; # @ARGV now contains the whole list of files. # other traditional code follows...
# On Win32 command line, you can invoke it like this: > perl foo.pl *.ex? "C:\Program Files\MySQ?\*.txt" abc.dat
This module provides a straight-forward interface for processing the wildcards used in Win32 command line. The standard File::DosGlob module maked my work minimal.
The unfold function globs the pattern appeared in @ARGV and assign the final file list back to @ARGV. Every element of @ARGV is treated as single pattern and white spaces are reserved.
I think the beauty of this stuff is just its simplicity. There is only one sub with no arguments and no return values.
unfold
Agent Zhang, <agent2002@126.com>
Copyright (C) 2005 Agent Zhang.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Win32::Wildcard - Unfold the wildcards contained in @ARGV automatically |