From: Christian Hansen Date: Wed, 27 Apr 2005 15:36:19 +0000 (+0000) Subject: Fixed config in C::Base and stash in C::Engine X-Git-Tag: 5.7099_04~1423 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=c19e2f4a25812c000f047d6128d566c55972f9f2;hp=386777dc6439f150392cbca5da094803296d3640 Fixed config in C::Base and stash in C::Engine --- diff --git a/lib/Catalyst/Base.pm b/lib/Catalyst/Base.pm index ec25476..869d474 100644 --- a/lib/Catalyst/Base.pm +++ b/lib/Catalyst/Base.pm @@ -92,8 +92,8 @@ sub new { sub config { my $self = shift; $self->_config( {} ) unless $self->_config; - if ( $_[0] ) { - my $config = $_[1] ? {@_} : $_[0]; + if ( @_ ) { + my $config = @_ > 1 ? {@_} : $_[0]; while ( my ( $key, $val ) = each %$config ) { $self->_config->{$key} = $val; } diff --git a/lib/Catalyst/Engine.pm b/lib/Catalyst/Engine.pm index d061984..d6673a2 100644 --- a/lib/Catalyst/Engine.pm +++ b/lib/Catalyst/Engine.pm @@ -698,8 +698,8 @@ Returns a hashref containing all your data. sub stash { my $self = shift; - if ( $_[0] ) { - my $stash = $_[1] ? {@_} : $_[0]; + if ( @_ ) { + my $stash = @_ > 1 ? {@_} : $_[0]; while ( my ( $key, $val ) = each %$stash ) { $self->{stash}->{$key} = $val; }