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

Re: Redirect subroutine output

by syphilis (Chancellor)
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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1069474]
help
Chatterbox?
LanX has to go go/
[holli]: baba

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (8)
As of 2017-11-20 19:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (293 votes). Check out past polls.

    Notices?