updated to version 0.08
[catagits/Catalyst-Runtime.git] / lib / Catalyst.pm
index 768e013..99a8767 100644 (file)
@@ -25,6 +25,8 @@ use attributes;
 use utf8;
 use Carp qw/croak/;
 
+BEGIN { require 5.008001; }
+
 __PACKAGE__->mk_accessors(
     qw/counter request response state action stack namespace stats/
 );
@@ -322,8 +324,8 @@ sub stash {
     if (@_) {
         my $stash = @_ > 1 ? {@_} : $_[0];
        croak('stash takes a hash or hashref') unless ref $stash;
-        while ( my ( $key, $val ) = each %$stash ) {
-            $c->{stash}->{$key} = $val;
+        foreach my $key ( keys %$stash ) {
+            $c->{stash}->{$key} = $stash->{$key};
         }
     }
     return $c->{stash};
@@ -593,8 +595,6 @@ sub component {
 
         $comp = $c->_comp_search($name);
         return $c->_filter_component( $comp, @_ ) if defined($comp);
-
-       croak("Unable to find component $name");
     }
 
     return sort keys %{ $c->components };