This was a follow-up to my previous post about system, which has:
"This is not what you want to use to capture the output from a command; for that you should use merely backticks or qx//, ..."
Of course, TMTOWTDI. :-)
| [reply] |
Hi Ken
Sorry, I have to disagree.
For numerous reasons it's best practice not to shell out for something which can be done inside Perl. (portability, performance, maintenance, security, ...)
It's even a bit worse, because ls is useless, if you just need the shell's globbing.
TMTOWTDI only covers this, if there is a good reason.
Anyway, let me point you to older discussions instead of reiterating the reasons °
°) thanks to eyepops++ for keeping this listed in his homenode! :)
| [reply] [d/l] |
"Sorry, I have to disagree."
Do you? What precisely are you disagreeing with?
Please provide a full, verbatim quote of anything I wrote that you disagree with.
The facts:
-
The OP asked how system could be used.
-
I provided an example in answer to this.
-
I followed this up with a further example contrasting system(...) (no capture of command output),
with `...` (capture of command output possible),
in accordance with the system documentation.
You seem to have concocted the idea that I recommended shelling out and,
on the basis of that fictitious notion,
decided that the appropriate action was to educate me.
My reference to TMTOWTDI, including a smiley, was simply a nod to the fact that other (better) ways were possible.
I've no idea where your modified definition originated;
I suggest you follow the link and read:
"This doesn’t mean that more ways are always better or that all possible paths are equally desirable ..."
There's certainly no reference to your:
"TMTOWTDI only covers this, if there is a good reason."
| [reply] [d/l] [select] |