X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst.pm;h=99a876766007c85bb4803bf60fb543ad17c71d67;hb=5e3aaea8f7dd01cbb1a874779a5f8d76e78fc232;hp=c894fed2b265b0391c05d010b6d8f1b81e42f0ab;hpb=34d28dfd33574ce30aca69fb8700b61111d97b92;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index c894fed..99a8767 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -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/ ); @@ -202,7 +204,9 @@ The following flags are supported: =head2 -Debug -Enables debug output. +Enables debug output. You can also force this setting from the system +environment with CATALYST_DEBUG or _DEBUG. The environment settings +override the app, with _DEBUG having highest priority. =head2 -Engine @@ -319,8 +323,9 @@ sub stash { my $c = shift; if (@_) { my $stash = @_ > 1 ? {@_} : $_[0]; - while ( my ( $key, $val ) = each %$stash ) { - $c->{stash}->{$key} = $val; + croak('stash takes a hash or hashref') unless ref $stash; + foreach my $key ( keys %$stash ) { + $c->{stash}->{$key} = $stash->{$key}; } } return $c->{stash}; @@ -488,7 +493,7 @@ Gets a L instance by name. $c->model('Foo')->do_stuff; If the name is omitted, it will look for a config setting 'default_model', -or check if there is only one model, and forward to it if that's the case. +or check if there is only one view, and return it if that's the case. =cut