in reply to Preprocessing print statements
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
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
UPDATED: Clarified that these are two different approaches.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Preprocessing print statements
by mauroid (Initiate) on Nov 11, 2020 at 13:42 UTC | |
by LanX (Saint) on Nov 11, 2020 at 13:55 UTC | |
by karlgoethebier (Abbot) on Nov 12, 2020 at 07:12 UTC | |
by LanX (Saint) on Nov 12, 2020 at 15:06 UTC | |
by karlgoethebier (Abbot) on Nov 12, 2020 at 22:00 UTC | |
|