Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Redirect subroutine output

by syphilis (Canon)
on Jan 06, 2014 at 08:54 UTC ( #1069474=note: print w/ replies, xml ) Need Help??


in reply to Redirect subroutine output

Not sure if this counts as a "redirection to file":

use strict; use warnings; open WR, '>', 'file.out' or die "Can't open WR for writing: $!"; print WR foo(); close WR or die "Can't close WR: $!"; sub foo { return 'FOO'; }
Cheers,
Rob


Comment on Re: Redirect subroutine output
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2014-08-30 17:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (293 votes), past polls