Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re^8: capturing command output

by pklausner (Scribe)
on Jan 27, 2012 at 13:26 UTC ( #950363=note: print w/replies, xml ) Need Help??

in reply to Re^7: capturing command output
in thread capturing command output

Although the original does no logging, I dared to propose that this might be useful for non-trivial calls. As might be a redirection duplication of stderr and/or stdout to some location where you can inspect it. Or show it depending on a verbosity option.
And yes, all of this is unnecessary in perfect code.

Replies are listed 'Best First'.
Re^9: capturing command output
by JavaFan (Canon) on Jan 27, 2012 at 13:31 UTC
    Sure, but that still doesn't explain why it's better to do your own implementation of backticks right from the start. Given my trivial implementation of your wished extra layer of indirection, gives you all the hooks you want to add logging, redirection, or whatever you may wish to do. But unless there's an actual reason to do the logging, redirection, or whatever, there's no need to do it.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://950363]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2016-12-04 22:45 GMT
Find Nodes?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:

    Results (70 votes). Check out past polls.