Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: How to output backtick or qx to a variable and STDOUT at the same time?

by dr.jekyllandme (Sexton)
on Nov 20, 2012 at 06:43 UTC ( #1004665=note: print w/replies, xml ) Need Help??


in reply to Re: How to output backtick or qx to a variable and STDOUT at the same time?
in thread How to output backtick or qx to a variable and STDOUT at the same time?

Thank you! Looking over at Capture::Tiny's doc, I found tee. Which is exactly what I needed. Output both to STDOUT and store in a variable for later use.
#!usr/bin/perl use strict; use warnings; use Capture::Tiny qw(capture tee); my ($stdout, $stderr, $exit) = tee { system('ls', '-l'); }; print $stdout;
  • Comment on Re^2: How to output backtick or qx to a variable and STDOUT at the same time?
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1004665]
help
Chatterbox?
[erix]: surely such a handshake is enough to impeach the idiot :)
[erix]: one can only hope the Pope will administer the same humiliation
Discipulus the pope is the last good politic here around..sigh

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2017-05-24 07:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?