From: rkinyon Date: Mon, 20 Feb 2006 04:01:10 +0000 (+0000) Subject: Cleaned up a little bit more X-Git-Tag: 0-97~36 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0795f29063278576f1e095df34fc425801a3d0df;p=dbsrgits%2FDBM-Deep.git Cleaned up a little bit more --- diff --git a/lib/DBM/Deep.pm b/lib/DBM/Deep.pm index 797a2b4..b36f78a 100644 --- a/lib/DBM/Deep.pm +++ b/lib/DBM/Deep.pm @@ -36,7 +36,7 @@ use Digest::MD5 (); use Scalar::Util (); use vars qw( $VERSION ); -$VERSION = "0.96"; +$VERSION = q(0.96); ## # Set to 4 and 'N' for 32-bit offset tags (default). Theoretical limit of 4 GB per file. @@ -131,36 +131,31 @@ sub new { return bless $self, $class; } -{ - my @outer_params = qw( type base_offset ); - sub _init { - ## - # Setup $self and bless into this class. - ## - my $class = shift; - my $args = shift; - - # These are the defaults to be optionally overridden below - my $self = { - type => TYPE_HASH, - base_offset => length(SIG_FILE), - }; +sub _init { + ## + # Setup $self and bless into this class. + ## + my $class = shift; + my $args = shift; - bless $self, $class; + # These are the defaults to be optionally overridden below + my $self = bless { + type => TYPE_HASH, + base_offset => length(SIG_FILE), + }, $class; - foreach my $outer_parm ( @outer_params ) { - next unless exists $args->{$outer_parm}; - $self->{$outer_parm} = delete $args->{$outer_parm} - } - - $self->{root} = exists $args->{root} - ? $args->{root} - : DBM::Deep::_::Root->new( $args ); + foreach my $param ( keys %$self ) { + next unless exists $args->{$param}; + $self->{$param} = delete $args->{$param} + } + + $self->{root} = exists $args->{root} + ? $args->{root} + : DBM::Deep::_::Root->new( $args ); - if (!defined($self->fh)) { $self->_open(); } + if (!defined($self->fh)) { $self->_open(); } - return $self; - } + return $self; } sub TIEHASH {