Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Challenge: Capturing stdout from a function call.

by PodMaster (Abbot)
on Oct 21, 2004 at 09:36 UTC ( [id://401102]=note: print w/replies, xml ) Need Help??


in reply to Challenge: Capturing stdout from a function call.

It doesn't look like you can without hacking Perl. Try
close STDOUT; # comment out to see the difference, try opening STD +OUT to something else use Perl; my $p = Perl->new( ARGV => [ '-le', 'print(1)for(1..22)'] ); $p->run;
Looks like you'll have to settle for an intermediary file (open STDOUT, '>', ...).

MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
** The third rule of perl club is a statement of fact: pod is sexy.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://401102]
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: (3)
As of 2024-04-25 18:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found