in reply to Re (tilly) 1: overloading the print function (or alternatives)
in thread overloading the print function (or alternatives)
Something I DON'T know, however... would one need to prototype this overloaded print() to assure that it would work when used without parenthases, or is that taken care of becuase the built-in print() is already prototyped? You'd probably want to be sure beore doing it this way.sub print { my $string = join '', @_; if ($string =~ /^(Content-type:)/) { CORE::print $string; } else { CORE::print "Content-type: text/html\n\n"; die "You used print() rather than returning a string, you naughty +person"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re (tilly) 3: overloading the print function (or alternatives)
by tilly (Archbishop) on Dec 04, 2000 at 23:57 UTC |