laziness, impatience, and hubris | |
PerlMonks |
Re: Preprocessing print statementsby LanX (Saint) |
on Nov 11, 2020 at 12:19 UTC ( [id://11123584]=note: print w/replies, xml ) | Need Help?? |
two alternative approaches: a) If you are OK with buffering, you can still use select with a filehandle opened to a \$scalar and filter the scalar before printing. This has the advantage of minimal changes. b) Personally I'd prefer my own out() routine - closing over a regex var - to replace all needed prints. That'll give you finer control over the single print chunks. HTH
Cheers Rolf UPDATED: Clarified that these are two different approaches.
In Section
Seekers of Perl Wisdom
|
|