[Melbourne-pm] overloading 'print'
Andrew Savige
ajsavige at yahoo.com.au
Thu Mar 16 23:56:06 PST 2006
--- Mathew Robertson wrote:
> I have a situation where I would like to overload the 'print' and
> 'printf' functions, so that I can do some translation stuff in them.
Use tie? For example:
http://search.cpan.org/src/MSCHWERN/Test-Simple-0.49/t/lib/TieOut.pm
When trying to test print failures I asked this same question a while
back:
http://www.perlmonks.org/?node_id=454223
Some of the responses might be of use.
Re overriding print for QA/testing purposes, Ovid describes a
white-boxy hack:
http://www.nntp.perl.org/group/perl.qa/3053
Though Schwern didn't like it:
http://www.nntp.perl.org/group/perl.qa/3149
http://www.nntp.perl.org/group/perl.qa/3148
See also:
http://search.cpan.org/dist/Test-Output/
HTH,
/-\
Send instant messages to your online friends http://au.messenger.yahoo.com
More information about the Melbourne-pm
mailing list