in reply to Re: Handling cascading defaults
in thread Handling cascading defaults
I would actually organize that slightly differently:
And then in other code you would do this:package Err; sub new { return bless {}, shift; } sub err { my $self = shift; my %args = @_; # Do something with %args here }
$handler ||= new Err; # time passes &do_right_thing() or $handler->err(title=>'Oops',msg=>'something went +wrong');
In Section
Seekers of Perl Wisdom