Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Using currently selected filehandle

by erasei (Pilgrim)
on Jun 23, 2003 at 18:17 UTC ( [id://268259]=note: print w/replies, xml ) Need Help??


in reply to Using currently selected filehandle

Or do it the other way around, with a combination of yours and hardburn's methods. Name your sub to be 'printto' and then print to the filehand in the sub, like this:
my $fh = select; printto("Hello\n"); sub printto { my $string = shift; print $fh $string; }
Although it just seems like it'd be a lot either to just print it to the file hand directly as hardburn said.

Replies are listed 'Best First'.
Re: Re: Using currently selected filehandle
by sgifford (Prior) on Jun 23, 2003 at 18:22 UTC
    If you add a use strict to the top of that, it doesn't work.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2024-04-23 18:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found