Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Correct way to capture command output to a file in Perl.

by BillDowns (Novice)
on May 01, 2013 at 20:26 UTC ( [id://1031643]=note: print w/replies, xml ) Need Help??


in reply to Correct way to capture command output to a file in Perl.

I would probably just use Windows redirection:  `example.exe >output.txt`;Then read that file.

Replies are listed 'Best First'.
Re^2: Correct way to capture command output to a file in Perl.
by morgon (Priest) on May 02, 2013 at 15:02 UTC
    If you do it like that you would not use backticks but system() as you would not capture any output.

    But I would not do it like that as in the error-case it is more difficult to determine what went wrong (e.g. the command you call may be able to run, but may not be able to write to the file).

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1031643]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2024-04-25 13:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found