3 |
# $Id$ |
# $Id$ |
4 |
# |
# |
5 |
# $Log$ |
# $Log$ |
6 |
|
# Revision 1.3 2002/11/17 06:24:28 joko |
7 |
|
# + deep merge of arguments in case of ref HASH |
8 |
|
# |
9 |
# Revision 1.2 2002/10/17 00:06:16 joko |
# Revision 1.2 2002/10/17 00:06:16 joko |
10 |
# + advanced constructor argument shift-in |
# + advanced constructor argument shift-in |
11 |
# |
# |
23 |
# get logger instance |
# get logger instance |
24 |
my $logger = Log::Dispatch::Config->instance; |
my $logger = Log::Dispatch::Config->instance; |
25 |
|
|
26 |
|
use Data::Dumper; |
27 |
|
|
28 |
|
|
29 |
sub new { |
sub new { |
30 |
my $invocant = shift; |
my $invocant = shift; |
31 |
my $class = ref($invocant) || $invocant; |
my $class = ref($invocant) || $invocant; |
35 |
@_ && (@args = @_); |
@_ && (@args = @_); |
36 |
$logger->debug( __PACKAGE__ . "->new( @args )" ); |
$logger->debug( __PACKAGE__ . "->new( @args )" ); |
37 |
|
|
38 |
my $self = { @_ }; |
my $self = {}; |
39 |
return bless $self, $class; |
bless $self, $class; |
40 |
|
|
41 |
|
#print "dump: ", Dumper(@_), "\n"; |
42 |
|
#my $self = { @_ }; |
43 |
|
foreach (@_) { |
44 |
|
my $elem = $_; |
45 |
|
if (ref($elem) eq 'HASH') { |
46 |
|
foreach (keys %$elem) { |
47 |
|
$self->{$_} = $elem->{$_}; |
48 |
|
} |
49 |
|
} |
50 |
|
} |
51 |
|
|
52 |
|
return $self; |
53 |
} |
} |
54 |
|
|
55 |
sub native { |
sub native { |