diff options
author | Yorhel <git@yorhel.nl> | 2008-10-22 17:06:09 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2008-10-22 17:06:09 +0200 |
commit | 924792ce0009801b3ed2415ff4bbebed5ef8cb0f (patch) | |
tree | bd901bf7ab1c4a30dd349779b0fec2427cc21f1b /lib | |
parent | 3f10f18478c9962b16f338dba2d6cf3c73d27bb2 (diff) |
Modified reqParam to return a list without arguments, and added an example again
Diffstat (limited to 'lib')
-rw-r--r-- | lib/VNDB/Handler/Example.pm | 5 | ||||
-rw-r--r-- | lib/YAWF/Request.pm | 9 |
2 files changed, 11 insertions, 3 deletions
diff --git a/lib/VNDB/Handler/Example.pm b/lib/VNDB/Handler/Example.pm index 21a8639..36e419f 100644 --- a/lib/VNDB/Handler/Example.pm +++ b/lib/VNDB/Handler/Example.pm @@ -25,6 +25,11 @@ sub envdump { print $fd "\n"; print $fd "Header dump:\n"; printf $fd " %s: %s\n", $_, $self->reqHeader($_) for ($self->reqHeader()); + + # ..and this + print $fd "\n"; + print $fd "Param dump:\n"; + printf $fd " %s: %s\n", $_, $self->reqParam($_) for ($self->reqParam()); } diff --git a/lib/YAWF/Request.pm b/lib/YAWF/Request.pm index 5c122c9..09f12e4 100644 --- a/lib/YAWF/Request.pm +++ b/lib/YAWF/Request.pm @@ -40,9 +40,12 @@ sub reqInit { # Perl's internal UTF-8 format, and returns an empty string on undef. sub reqParam { my($s, $n) = @_; - return wantarray - ? map { defined $_ ? decode_utf8 $_ : '' } $s->{_YAWF}{Req}{c}->param($n) - : defined $s->{_YAWF}{Req}{c}->param($n) ? decode_utf8 $s->{_YAWF}{Req}{c}->param($n) : ''; + if($n) { + return wantarray + ? map { defined $_ ? decode_utf8 $_ : '' } $s->{_YAWF}{Req}{c}->param($n) + : defined $s->{_YAWF}{Req}{c}->param($n) ? decode_utf8 $s->{_YAWF}{Req}{c}->param($n) : ''; + } + return $s->{_YAWF}{Req}{c}->param(); } |