Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: send STDOUT STDERR to function

by Khen1950fx (Canon)
on May 12, 2013 at 12:01 UTC ( #1033190=note: print w/replies, xml ) Need Help??


in reply to send STDOUT STDERR to function

Its a FAQ. See: How can I capture STDERR from an external command?.
#!/usr/bin/perl use strict; use warnings; my $output = `whoami 2>&1`; name(); sub name { print "You are $output"; }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1033190]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2016-12-04 19:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (69 votes). Check out past polls.