signatures on anonymous subs

29 views
Skip to first unread message

mjb152

unread,
Oct 9, 2015, 7:36:09 AM10/9/15
to Mojolicious
I'm using signatures for my Controllers, and all works well.  I'd like to use them for helpers in my plugins,  but it doesn't appear to work.

use v5.22;
$app->helper(  logme => sub ( $c,$str ) {     $c->app->log->info($str)   });

gives error: Illegal character in prototype for ? : $self

working code
$app->helper(  logme => sub {
            my ($c, $str) = @_;
            $c->app->log->info($str);
 });

am I doing something wrong, or do subroutine signatures not work with anonymous subs under mojo helpers ?


sri

unread,
Oct 9, 2015, 7:38:55 AM10/9/15
to Mojolicious
use v5.22;

use experimental 'signatures';

--
sebastian 

mjb152

unread,
Oct 9, 2015, 7:43:47 AM10/9/15
to Mojolicious
doh !!!  working well now,  thanks. 
Reply all
Reply to author
Forward
0 new messages