in reply to print overloading
$ perl -le'print defined(prototype("CORE::print")) || 0' 0
But honestly, that's not what you want anyway. What if the program also uses printf or syswrite? What if the program wants to write to a file?
You want to present the interface of a variable, but with custom functionality. That's what magic is for. Specifically, you want to tie the handle you want redirected (presumably STDOUT). See Tie::Handle
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: print overloading
by Karger78 (Beadle) on Oct 29, 2009 at 19:21 UTC | |
by almut (Canon) on Oct 29, 2009 at 19:35 UTC |