Created
July 22, 2014 10:17
-
-
Save tianchaijz/bc39b4999ffb76858444 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Capture::Tiny 'tee'; | |
my $output = tee { system( "some command" ) }; | |
# http://stackoverflow.com/questions/634508/how-can-i-send-perl-output-to-a-both-stdout-and-a-variable | |
---- | |
use IPC::System::Simple qw(capture); | |
# Capture output into $result and throw exception on failure | |
my $result = capture("some_command"); | |
# http://stackoverflow.com/questions/2415954/how-can-i-store-perls-system-function-output-to-a-variable | |
---- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment