X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FRequest.pm;h=021bf2431cee439f1922a81a1d389961cedfeb2d;hb=4b0b748949f8aef8309806de2387296b17e5673d;hp=9f0e4ec6f599504b3bde626ea4c4c9a9690a2769;hpb=b111b5c1622ce29ea5524b552ddb1ab8ea614a1a;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Request.pm b/lib/Catalyst/Request.pm index 9f0e4ec..021bf24 100644 --- a/lib/Catalyst/Request.pm +++ b/lib/Catalyst/Request.pm @@ -439,6 +439,7 @@ Catalyst::Request - provides information about the current client request $req->uri; $req->user; $req->user_agent; + $req->env; See also L, L. @@ -644,9 +645,15 @@ sub param { return keys %{ $self->parameters }; } - if ( @_ == 1 ) { + # If anything in @_ is undef, carp about that, and remove it from + # the list; + + my @params = grep { defined($_) ? 1 : do {carp "You called ->params with an undefined value"; 0} } @_; + + if ( @params == 1 ) { - my $param = shift; + defined(my $param = shift @params) || + carp "You called ->params with an undefined value 2"; unless ( exists $self->parameters->{$param} ) { return wantarray ? () : undef; @@ -663,9 +670,9 @@ sub param { : $self->parameters->{$param}; } } - elsif ( @_ > 1 ) { - my $field = shift; - $self->parameters->{$field} = [@_]; + elsif ( @params > 1 ) { + my $field = shift @params; + $self->parameters->{$field} = [@params]; } } @@ -989,6 +996,9 @@ combined from those in the request and those in the body. If parameters have already been set will clear the parameters and build them again. +=head2 $self->env + +Access to the raw PSGI env. =head2 meta