nuked each() out of core with prejudice
[catagits/Catalyst-Runtime.git] / lib / Catalyst.pm
index 711fb16..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};