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

Re: overriding print built-in

by grantm (Parson)
on Apr 12, 2006 at 01:51 UTC ( #542731=note: print w/ replies, xml ) Need Help??


in reply to overriding print built-in

While you can't override print, you may be able to achieve your desired result using a tie instead.

For example, Sprog uses this module to translate code like this ...

print @args;

... into code like this ...

$some_object->print(@args);


Comment on Re: overriding print built-in
Select or Download Code
Re^2: overriding print built-in
by Fletch (Chancellor) on Apr 12, 2006 at 03:08 UTC

    Specifically you're going to be interested in the TIEHANDLE and related routines from perltie; and perhaps IO::Scalar or the like for inspiration.

Re^2: overriding print built-in
by jeremyh (Beadle) on Apr 13, 2006 at 17:12 UTC
    Thank you, this looks like it will work for what I want to do, which is to make a custom output formatting function send output from one server to another over an Oracle DB link, without touching the code of the custom output function.

    Thanks again,

    Jeremy

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (13)
As of 2014-09-22 19:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (198 votes), past polls