Is -d obscure?
- It's documented in the same place as -d.
- It's only used by -d and siblings.
- And it should be used just about everywhere -d is needed.
| [reply] [d/l] [select] |
How many places do you see '-d'? How many places do you see '_'? '-d' stands for directory. '_' stands for ??? -d is the same as the unix file test, '_' is the same as ???.
It might be easy for you to remember things like this, bit it isn't for me. I guarantee you, in a week if you showed me -d(_) I'll have to look it up. And who wants to do that?
Where is this code running? Is the performance that important? Is -d $filename so much slower?
--Pileofrogs
| [reply] [d/l] [select] |
-d $FILE stands for "test to see if $FILE is a directory";
_ stands for "the topic (of the current conversation)"*;
so, -d _ means "test to see if the last tested file is a directory";
*: $_ is the topic of the for, will be used by default by regexen and a lot of functions @_ is the collection of topics for a function (the arguments!) _ is the topic for file tests.
[]s, HTH, Massa (κς,πμ,πλ)
| [reply] [d/l] [select] |
| [reply] [d/l] [select] |