From: Arthur Axel 'fREW' Schmidt Date: Thu, 8 Jul 2010 03:52:37 +0000 (-0500) Subject: fix my silly example fails X-Git-Tag: v0.003~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FWeb-Simple.git;a=commitdiff_plain;h=c254b30eac99e264fab11207e3c10805b4092608 fix my silly example fails --- diff --git a/lib/Web/Simple.pm b/lib/Web/Simple.pm index e717bcd..e74caad 100644 --- a/lib/Web/Simple.pm +++ b/lib/Web/Simple.pm @@ -184,23 +184,23 @@ is encountered in other code. # matches: GET /user/1.htm?show_details=1 # GET /user/1.htm sub (GET + /user/* + ?show_details~ + .htm|.html|.xhtml) { - shift; my ($user_id, $show_details) = @_; + my ($self, $user_id, $show_details) = @_; ... }, # matches: POST /user?username=frew # POST /user?username=mst&first_name=matt&last_name=trout sub (POST + /user + ?username=&*) { - shift; my ($username, $misc_params) = @_; + my ($self, $username, $misc_params) = @_; ... }, # matches: DELETE /user/1/friend/2 sub (DELETE + /user/*/friend/*) { - shift; my ($user_id, $friend_id) = @_; + my ($self, $user_id, $friend_id) = @_; ... }, # matches: PUT /user/1?first_name=Matt&last_name=Trout sub (PUT + /user/* + ?first_name~&last_name~) { - shift; my ($user_id, $first_name, $last_name) = @_; + my ($self, $user_id, $first_name, $last_name) = @_; ... }, sub (/user/*/...) { @@ -214,7 +214,7 @@ is encountered in other code. }, # matches: DELETE /user/1/role/1 sub (DELETE + /role/*) { - my $role_id = shift; + my $role_id = $_[1]; ... }, ];