in reply to Fun with Farcical Factories (Was: Re^4: Your favorite objects NOT of the hashref phylum)
in thread Your favorite objects NOT of the hashref phylum
Although you've responded to your own post rather than me, I'll assume the guilt for 'now being dogmatic' :) I'll also accept the judgement that I'm "simply lacking in mental horsepower" to see how this works?
Following on from your logger example. Each place in your application you have something like
package Some::Class; use Logger; sub new { ... $self->{logger} = Logger->new; ... } sub print_to_log { my $self = shift; $self->{logger}->( @_ ) } sub someMethod { my( $self ) = @_; ... $self->print_to_log( 'some stuff' ); ... } sub someOtherMethod { my( $self ) = @_; ... $self->print_to_log( 'some other stuff' ); ... }
Could you explain to me how you would arrange for the logging from someMethod to go to one file, and the logging from someOtherMethod to go to a different file without changing Some::Class?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Fun with Farcical Factories (Was: Re^4: Your favorite objects NOT of the hashref phylum)
by aufflick (Deacon) on Mar 30, 2006 at 12:15 UTC |