Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: !Overriding Builtin print

by Jenda (Abbot)
on Oct 20, 2003 at 17:43 UTC ( #300675=note: print w/replies, xml ) Need Help??


in reply to !Overriding Builtin print

You are not supposed to override print (that'd be far too global to be usefull anyway), but to create a class and tie a FILEHANDLE to it. If you then select that handle your print()s will do whatever you want at all.

See perldoc perltie and perldoc Tie::Handle. There are two different classes for tied FILEHANDLEs within Mail::Sender is you wanted more examples.

Jenda
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
   -- Rick Osborne

Edit by castaway: Closed small tag in signature

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://300675]
help
Chatterbox?
[marioroy]: Hi all, am looking up __SUB__. Interesting.
[marioroy]: That's cool.
[marioroy]: Thanks. Have learned a new thing in Perl.
[MidLifeXis]: Hmm, do NTC nodes timeout? I thought considerations were forever.

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (11)
As of 2017-05-24 17:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?