™.. File::DosGlob - Online Linux Manual PageSection : 3pm
Updated : 2009-02-12
Source : perl v5.10.1
Note : Perl Programmers Reference Guide

NAMEFile::DosGlob − DOS like globbing and then some

SYNOPSIS​ require 5.004; ​ ​ # override CORE::glob in current package ​ use File::DosGlob 'glob'; ​ ​ # override CORE::glob in ALL packages (use with extreme caution!) ​ use File::DosGlob 'GLOBAL_glob'; ​ ​ @perlfiles = glob "..\\pe?l/*.p?"; ​ print <..\\pe?l/*.p?>; ​ ​ # from the command line (overrides only in main::)> perl −MFile::DosGlob=glob −e "print <../pe*/*p?>"

DESCRIPTIONA module that implements DOS-like globbing with a few enhancements. It is largely compatible with perlglob.exe (the M$ setargv.obj version) in all but one respect\*(--it understands wildcards in directory components. For example, \*(C`<..\e\el*b\e\efile/*glob.p?\*(C'\fR> will work as expected (in that it will find something like '..\lib\File/DosGlob.pm' alright). Note that all path components are case-insensitive, and that backslashes and forward slashes are both accepted, and preserved. You may have to double the backslashes if you are putting them in literally, due to double-quotish parsing of the pattern by perl. Spaces in the argument delimit distinct patterns, so ​\*(C`glob(\*(Aq*.exe *.dll\*(Aq)\*(C'\fR globs all filenames that end in \f(CW\*(C`.exe\*(C'\fR or \*(C`.dll\*(C'\fR. If you want to put in literal spaces in the glob pattern, you can escape them with either double quotes, or backslashes. e.g. \*(C`glob(\*(Aqc:/"Program Files"/*/*.dll\*(Aq)\*(C'\fR, or ​\*(C`glob(\*(Aqc:/Program\e Files/*/*.dll\*(Aq)\*(C'\fR. The argument is tokenized using ​\*(C`Text::ParseWords::parse_line()\*(C'\fR, so see Text::ParseWords for details of the quoting rules used. Extending it to csh patterns is left as an exercise to the reader.

NOTES• Mac OS (Classic) users should note a few differences. The specification of pathnames in glob patterns adheres to the usual Mac OS conventions: The path separator is a colon ':', not a slash '/' or backslash '\'. A full path always begins with a volume name. A relative pathname on Mac ​OS must always begin with a ':', except when specifying a file or directory name in the current working directory, where the leading colon is optional. If specifying a volume name only, a trailing ':' is required. Due to these rules, a glob like <*:> will find all mounted volumes, while a glob like <*> or <:*> will find all files and directories in the current directory. Note that updirs in the glob pattern are resolved before the matching begins, i.e. a pattern like *HD:t?p::a* will be matched as *HD:a*. Note also, that a single trailing ':' in the pattern is ignored (unless it's a volume name pattern like *HD:), i.e. a glob like <:*:> will find both directories ​and files (and not, as one might expect, only directories). The metachars '*', '?' and the escape char '\' are valid characters in volume, directory and file names on Mac OS. Hence, if you want to match a '*', '?' or '\' literally, you have to escape these characters. Due to perl's quoting rules, things may get a bit complicated, when you want to match a string like '\*' literally, or when you want to match '\' literally, but treat the immediately following character '*' as metachar. So, here's a rule of thumb (applies to both single− and double-quoted strings): escape each '*' or '?' or '\' with a backslash, if you want to treat them literally, and then double each backslash and your are done. E.g. ​− Match '\*' literally ​ escape both '\' and '*' : '\\\*' ​ double the backslashes : '\\\\\\*' (Internally, the glob routine sees a '\\\*', which means that both '\' and ​'*' are escaped.) ​− Match '\' literally, treat '*' as metachar ​ escape '\' but not '*' : '\\*' ​ double the backslashes : '\\\\*' (Internally, the glob routine sees a '\\*', which means that '\' is escaped and ​'*' is not.) Note that you also have to quote literal spaces in the glob pattern, as described above.

EXPORTS (by request only)glob()

BUGSShould probably be built into the core, and needs to stop pandering to DOS habits. Needs a dose of optimizium too.

AUTHORGurusamy Sarathy <gsar@activestate.com>

HISTORY• Support for globally overriding glob() (GSAR 3−JUN−98) • Scalar context, independent iterator context fixes (GSAR 15−SEP−97) • A few dir-vs-file optimizations result in glob importation being 10 times faster than using perlglob.exe, and using perlglob.bat is only twice as slow as perlglob.exe (GSAR 28−MAY−97) • Several cleanups prompted by lack of compatible perlglob.exe under Borland (GSAR 27−MAY−97) • Initial version (GSAR 20−FEB−97)

SEE ALSOperl perlglob.bat Text::ParseWords
0
Johanes Gumabo
Data Size   :   16,200 byte
man-File::DosGlob.3pmBuild   :   2024-12-29, 07:25   :  
Visitor Screen   :   x
Visitor Counter ( page / site )   :   6 / 255,442
Visitor ID   :     :  
Visitor IP   :   3.139.93.168   :  
Visitor Provider   :   AMAZON-02   :  
Provider Position ( lat x lon )   :   39.962500 x -83.006100   :   x
Provider Accuracy Radius ( km )   :   1000   :  
Provider City   :   Columbus   :  
Provider Province   :   Ohio ,   :   ,
Provider Country   :   United States   :  
Provider Continent   :   North America   :  
Visitor Recorder   :   Version   :  
Visitor Recorder   :   Library   :  
Online Linux Manual Page   :   Version   :   Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.29
Online Linux Manual Page   :   Library   :   lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page   :   Library   :   lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base   :   Version   :   Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base   :   Library   :   lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36

Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.

ERROR : Need New Coding :         (parse_manual_page_|252|File::DosGlob.3pm|36/37|el══─{─══.|.el══─{─══. ds -- \|\(em\| )         (htmlprn|149|File::DosGlob.3pm|36/37|.el══─{─══. ds --  —  |.el══─{─══. ds -- \|\(em\| )         (parse_manual_page_|252|File::DosGlob.3pm|41|br══─}─══|'br══─}─══ )         (htmlprn|149|File::DosGlob.3pm|41|'br══─}─══ |'br══─}─══ )         (rof_nr_x|149|File::DosGlob.3pm|51/52|\nF|.ie \nF ══─{─══. de IX )         (rof_unit_scale_px|41|File::DosGlob.3pm|51/52|F|.ie \nF ══─{─══. de IX )         (rof_if|19|File::DosGlob.3pm|51/52|\nF|.ie \nF ══─{─══. de IX )         (htmlprn|149|File::DosGlob.3pm|51/52|.ie \nF ══─{─══. de IX|.ie \nF ══─{─══. de IX )         (rof_escape_sequence|91|File::DosGlob.3pm|53|\$1\t\\n%\t"\\$2" |. tm Index:\\$1\t\\n%\t"\\$2" )         (parse_manual_page_|252|File::DosGlob.3pm|57|══─}─══|.══─}─══ )         (htmlprn|149|File::DosGlob.3pm|57|.══─}─══ |.══─}─══ )         (rof_escape_sequence|91|File::DosGlob.3pm|155|\*(--it understands wildcards in |version) in all but one respect\*(--it understands wildcards in )         (rof_escape_sequence|91|File::DosGlob.3pm|158|\*(C`<..\e\el*b\e\efile/*glob.p?\*(C'\fR> will work as expected (in |For example, \f(CW\*(C`<..\e\el*b\e\efile/*glob.p?\*(C'\fR> will work as expected (in )         (rof_escape_sequence|91|File::DosGlob.3pm|166|\*(C`glob(\*(Aq*.exe *.dll\*(Aq)\*(C'\fR globs all filenames that end in \f(CW\*(C`.exe\*(C'\fR |\&\f(CW\*(C`glob(\*(Aq*.exe *.dll\*(Aq)\*(C'\fR globs all filenames that end in \f(CW\*(C`.exe\*(C'\fR )         (rof_escape_sequence|91|File::DosGlob.3pm|167|\*(C`.dll\*(C'\fR. If you want to put in literal spaces in the glob |or \f(CW\*(C`.dll\*(C'\fR. If you want to put in literal spaces in the glob )         (rof_escape_sequence|91|File::DosGlob.3pm|169|\*(C`glob(\*(Aqc:/"Program Files"/*/*.dll\*(Aq)\*(C'\fR, or |e.g. \f(CW\*(C`glob(\*(Aqc:/"Program Files"/*/*.dll\*(Aq)\*(C'\fR, or )         (rof_escape_sequence|91|File::DosGlob.3pm|170|\*(C`glob(\*(Aqc:/Program\e Files/*/*.dll\*(Aq)\*(C'\fR. The argument is tokenized using |\&\f(CW\*(C`glob(\*(Aqc:/Program\e Files/*/*.dll\*(Aq)\*(C'\fR. The argument is tokenized using )         (rof_escape_sequence|91|File::DosGlob.3pm|171|\*(C`Text::ParseWords::parse_line()\*(C'\fR, so see Text::ParseWords for details |\&\f(CW\*(C`Text::ParseWords::parse_line()\*(C'\fR, so see Text::ParseWords for details )