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

Re^2: Python -V command not returning any value ( Capture::Tiny )

by mr_ron (Chaplain)
on Sep 29, 2015 at 02:46 UTC ( [id://1143308]=note: print w/replies, xml ) Need Help??


in reply to Re: Python -V command not returning any value ( Capture::Tiny )
in thread Python -V command not returning any value

I came up with a solution using IPC::Open3 before reading your posting with more care. I am new to Capture::Tiny and thank you for the introduction. IPC::Open3 also works but Capture::Tiny can provide something simpler. Your code is interesting pedagogically but the example is as complicated as an open3 solution and maybe a little overkill for the problem.

use strict; use warnings; use Capture::Tiny 'capture_merged'; my $python_ver = capture_merged { system('python', '-V') }; print "Python version is: $python_ver\n";
Ron

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2024-04-19 15:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found