/[cvs]/nfo/perl/libs/Data/Storage/Locator.pm
ViewVC logotype

Diff of /nfo/perl/libs/Data/Storage/Locator.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by joko, Thu Oct 17 00:06:16 2002 UTC revision 1.3 by joko, Sun Nov 17 06:24:28 2002 UTC
# Line 3  Line 3 
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  #  #
# Line 20  use warnings; Line 23  use warnings;
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;
# Line 29  sub new { Line 35  sub new {
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 {

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed