in reply to Perl <dir_with_wildcards>
"Hidden" a bit further down under I/O Operators:
If what's within the angle brackets is neither a filehandle nor a simple scalar variable containing a filehandle name, typeglob, or typeglob reference, it is interpreted as a filename pattern to be globbed, and either a list of filenames or the next filename in the list is returned, depending on context.
This is implemented by glob and File::Glob. Note that glob has a few caveats one should be aware of: It does not list filenames beginning with a dot by default, and it splits its argument on whitespace, which may be important in case you are interpolating variables into the pattern - you can use File::Glob ':bsd_glob'; to alleviate the latter caveat. Your particular usage </home/*/data/*.txt> (or equivalently, glob('/home/*/data/*.txt')) should be fine though.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Perl <dir_with_wildcards>
by RMGir (Prior) on Dec 14, 2017 at 14:21 UTC | |
by LanX (Saint) on Dec 14, 2017 at 17:51 UTC | |
by davido (Cardinal) on Dec 14, 2017 at 15:36 UTC | |
by duff (Parson) on Dec 14, 2017 at 17:09 UTC | |
by kcott (Archbishop) on Dec 15, 2017 at 04:17 UTC |