Printing to multiple files ... without changing my code.

McGlinchy, Alistair Alistair.McGlinchy at marks-and-spencer.com
Fri Sep 15 19:46:13 BST 2006


Dan Rowles wrote:

> Would you be willing to replace your print statements with something
> like Log::Log4perl?

Not really in this particular case. Some of the output is returned from
a script written in a previous century which I am very reluctant to
touch. 

> Much more heavyweight than just using print, but *very* flexible :)

I will look into it but my gut feel is portability will be an issue (NT4
(with Perl v5.004!), XP, AIX, and Linux)... Oh I see it's PPM-able so
there's a chance I could use it here. 

Also its always months after I've been playing with some code that I
think "ooh logging would be nice here".  Shoe-horning a logger module
into an existing script is very difficult and requires that the logger
code is available on all systems you plan to run your code. Munging warn
statements with a variable $SIG{__WARN__} is easy and portable.

Cheers

Alistair





**********************************************************************
Registered Office:
Marks and Spencer plc
Waterside House
35 North Wharf Road
London
W2 1NW

Registered No. 214436 in England and Wales.

Telephone (020) 7935 4422
Facsimile (020) 7487 2670

<<www.marksandspencer.com>>

Please note that electronic mail may be monitored.

This e-mail is confidential. If you received it by mistake, please let us know and then delete it from your system; you should not copy, disclose, or distribute its contents to anyone nor act in reliance on this e-mail, as this is prohibited and may be unlawful.
2005





More information about the london.pm mailing list