diff options
author | Yorhel <git@yorhel.nl> | 2009-07-04 14:27:17 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2009-07-04 14:27:17 +0200 |
commit | fcd581a553d3dc8264debc85d2d7fbf959d122e8 (patch) | |
tree | a7de71dad01a325e398fcc612aba795eed12e40a | |
parent | 0aed5e728eaa7c71af9a26426d4492cac7dbbabc (diff) |
Properly give undef as argument when a URL subpattern didn't match
This gets rid of the following sequence of warnings:
Use of uninitialized value in subtraction (-) at yawf/lib/YAWF.pm line 143.
Use of uninitialized value in subtraction (-) at yawf/lib/YAWF.pm line 143.
Use of uninitialized value in substr at yawf/lib/YAWF.pm line 143.
-rw-r--r-- | lib/YAWF.pm | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/YAWF.pm b/lib/YAWF.pm index b9fe7f8..062cae6 100644 --- a/lib/YAWF.pm +++ b/lib/YAWF.pm @@ -140,7 +140,7 @@ sub handle_request { my @args; for (@handlers ? 0..$#handlers/2 : ()) { if($loc =~ /^$handlers[$_*2]$/) { - @args = map { substr $loc, $-[$_], $+[$_]-$-[$_] } 1..$#- if $#-; + @args = map defined $-[$_] ? substr $loc, $-[$_], $+[$_]-$-[$_] : undef, 1..$#- if $#-; $han = $handlers[$_*2+1]; last; } |