in reply to Re: RFC: Creating Dancer2 validation plugin.
in thread RFC: Creating Dancer2 validation plugin.
>I'd have:sub _register_hooks { my $self = shift; $self->app->add_hook( Dancer2::Core::Hook->new( name => 'before_template_render', code => sub { my $tokens = shift; ...sub _register_hooks { my ($self, $token) = @_; ...
But that's not equivalent! Note the anonymous sub, the second shift happens in a nested subroutine, it uses its arguments, not the _register_hooks' ones.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: RFC: Creating Dancer2 validation plugin.
by stevieb (Canon) on May 05, 2022 at 14:51 UTC |