So if just feeding it a user-supplied filename, which may or may not contain wildcards, you don't want non-existing files to just disappear from the list. But with wildcards, no matches is no matches! Seems inconsistant. That is, I don't know why you would want
@ARGV= map glob, @list;
to work the way you say, unless you are also assuming that non-wildcard names are output files. I suppose the shell works this way because the
whole line is passed through glob, and it doesn't know which items are supposed to be filenames or not. So as a point of design for
that purpose, any string with no globbing characters are passed through unchanged.
I can see the point about not reading a whole directory to see if one file exists. That's for OS's that don't have glob support on their directory listing primitive, I suppose.
—John
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.