[dancer-users] passing a variable to a new subroutine route

Richard Reina gatorreina at gmail.com
Sun Aug 23 20:31:58 BST 2015


PLEASE IGNORE MY POST SENT MOMENTS AGO. I WAS NOT FINISHED TYPING.


I have the following post that gets a user's selection from a
page then looks up the corresponding records for the selection and

put them into a hash refrence. THat part works fine. How can I then
call another page/route

with that hash_refrence?


For example;


 post '/mypage' => sub { # let user make a selection        my
$select_id = params->{Sselect};        print "\n\nLooks Like They
Selected No: $select_id\n\n";

    # look up DB records corresponding to $select_id;

    # store them in hash refrence $sel_ref

}

 Now I would like to call template/page sport_add but I would like it
to have $sel_ref so

 that it could put that data into the template sport_add

get '/sport_add' => sub {   template 'sport_add.tt', {
      'MyTypes' => $sel_ref,  #
      'Testing'   => "This is text to test to make sure this will come
through",
      # to test, use this like <% Testing %> on your template page

}, {};

};


Thanks for any help. Have a great afternoon.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20150823/2c12c43c/attachment.html>


More information about the dancer-users mailing list