Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^5: How to capture and verify STDOUT of a Perl Module

by 2teez (Priest)
on Jul 29, 2013 at 21:20 UTC ( #1046918=note: print w/ replies, xml ) Need Help??


in reply to Re^4: How to capture and verify STDOUT of a Perl Module
in thread How to capture and verify STDOUT of a Perl Module

I know, but if system() runs something that produces output, I want it captured and can't:
Not so!!. Because system is not what you want to use to capture the output from a command use backticks or qx has it has been shown by others.
Then you can test your output if you want.

If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me


Comment on Re^5: How to capture and verify STDOUT of a Perl Module
Re^6: How to capture and verify STDOUT of a Perl Module
by yuri123 (Novice) on Jul 30, 2013 at 19:43 UTC
    Ok, I wanted to capture output from a call to a class method. Class method produces output by various means: print, system etc. Test::Output ties STDOUT and captures the calls to print and printf. As such it misses everything else including output from system(). I switched to Capture::Tiny and everything is great.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2014-08-30 03:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (291 votes), past polls