go ahead... be a heretic | |
PerlMonks |
Re: Need Help: Capture STDOUT without Redirectingby jpeg (Chaplain) |
on May 04, 2006 at 21:20 UTC ( [id://547526]=note: print w/replies, xml ) | Need Help?? |
I feel dirty for even suggesting it, but perldoc perlsub tells you how to override builtin functions. I hacked up an example overriding 'print' that called CORE::print twice - once to STDOUT and once to a filehandle, so I know 'print' can be overridden. That won't work for you: I needed to call my print as &print and you said you've no access to the sub.
I feel even dirtier suggesting you look into importing your print function into CORE::GLOBAL. It's definitely dangerous, but hey, the functionality is there.
-- jpg
In Section
Seekers of Perl Wisdom
|
|