[dancer-users] Dancer2::Plugin to_json

Hagop "Jack" Bilemjian jck000 at gmail.com
Mon Aug 15 20:38:39 BST 2016


sub BUILD {
  my $plugin = shift;
  my $app    = $plugin->app;

  $plugin->app->add_route(
    method => 'get',
    regexp => qr!/mypagel!,
    code   => \&myfuncl,
  );

Then, in sub myfunc {  I want to call to_json.  Right now, I'm doing a use
JSON, and it works properly.  Is there a way to call the serialozer from
the app like $app->to_json?  What is recommended?

Thanks,

Jack
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20160815/6ec29637/attachment.html>


More information about the dancer-users mailing list