in reply to Python -V command not returning any value
I have very simple program ... Could anyone please tell me how to get the info? thanks --girija
Use the convenience that is Capture::Tiny and the Basic debugging checklist
#!/usr/bin/perl -- use strict; use warnings; use Capture::Tiny qw/ capture /; use Data::Dump qw/ dd /; my @cmd = ( 'python', '-V' ); my( $stdout, $stderr, $exit ) = capture { system { $cmd[0] } @cmd; };; dd({ stdout => $stdout, stderr => $stderr, exit => $exit } ); __END__ { exit => 0, stderr => "Python 2.5\n", stdout => "" }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Python -V command not returning any value ( Capture::Tiny )
by gjoshi (Sexton) on Sep 28, 2015 at 07:50 UTC | |
|
Re^2: Python -V command not returning any value ( Capture::Tiny )
by mr_ron (Deacon) on Sep 29, 2015 at 02:46 UTC |