--- nfo/perl/libs/Data/Storage/Locator.pm 2002/10/17 00:06:16 1.2 +++ nfo/perl/libs/Data/Storage/Locator.pm 2002/11/17 06:24:28 1.3 @@ -1,8 +1,11 @@ ################################# # -# $Id: Locator.pm,v 1.2 2002/10/17 00:06:16 joko Exp $ +# $Id: Locator.pm,v 1.3 2002/11/17 06:24:28 joko Exp $ # # $Log: Locator.pm,v $ +# Revision 1.3 2002/11/17 06:24:28 joko +# + deep merge of arguments in case of ref HASH +# # Revision 1.2 2002/10/17 00:06:16 joko # + advanced constructor argument shift-in # @@ -20,6 +23,9 @@ # get logger instance my $logger = Log::Dispatch::Config->instance; +use Data::Dumper; + + sub new { my $invocant = shift; my $class = ref($invocant) || $invocant; @@ -29,8 +35,21 @@ @_ && (@args = @_); $logger->debug( __PACKAGE__ . "->new( @args )" ); - my $self = { @_ }; - return bless $self, $class; + my $self = {}; + bless $self, $class; + +#print "dump: ", Dumper(@_), "\n"; + #my $self = { @_ }; + foreach (@_) { + my $elem = $_; + if (ref($elem) eq 'HASH') { + foreach (keys %$elem) { + $self->{$_} = $elem->{$_}; + } + } + } + + return $self; } sub native {