Fixed config in C::Base and stash in C::Engine
Christian Hansen [Wed, 27 Apr 2005 15:36:19 +0000 (15:36 +0000)]
lib/Catalyst/Base.pm
lib/Catalyst/Engine.pm

index ec25476..869d474 100644 (file)
@@ -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;
         }
index d061984..d6673a2 100644 (file)
@@ -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;
         }