Dude... this is what functions are for. You're stretching Dancer in incorrect ways, which gives you grief. You should be opting for simple elegant coding solutions, and that's something you can easily do using refactored subroutines. get '/json/....' => sub { my_json_parsing_function(@_) }; get '/bar/:format' => sub { ...... my $result = my_json_parsing_function("stuff"); [# do something with result...] }; Seriously... :) On Tue, Oct 25, 2011 at 3:40 PM, Puneet Kishor <punk.kish@gmail.com> wrote:
Is something like the following possible (see the line marked />+/)? Or, even advisable?
get '/foo.:format' => sub { my $a = param 'a'; my $b = param 'b';
my $res = query_db($a, $b); return to_json $res; }
get '/bar.:format' => sub { my $a = param 'a'; my $b = param 'b';
>>>>>> my $res_foo = <somehow call /foo.json?a=$a&b=$b>; my $res = do_something($res_foo); return to_json $res; }
-- Puneet Kishor _______________________________________________ Dancer-users mailing list Dancer-users@perldancer.org http://www.backup-manager.org/cgi-bin/listinfo/dancer-users