{"action":"created","issue":{"url":"https://api.github.com/repos/kraih/mojo/issues/756","labels_url":"https://api.github.com/repos/kraih/mojo/issues/756/labels{/name}","comments_url":"https://api.github.com/repos/kraih/mojo/issues/756/comments","events_url":"https://api.github.com/repos/kraih/mojo/issues/756/events","html_url":"https://github.com/kraih/mojo/issues/756","id":59952743,"number":756,"title":"Deep recursion while dumper transaction in after_build_tx hook","user":{"login":"avkhozov","id":427039,"avatar_url":"https://avatars.githubusercontent.com/u/427039?v=3","gravatar_id":"","url":"https://api.github.com/users/avkhozov","html_url":"https://github.com/avkhozov","followers_url":"https://api.github.com/users/avkhozov/followers","following_url":"https://api.github.com/users/avkhozov/following{/other_user}","gists_url":"https://api.github.com/users/avkhozov/gists{/gist_id}","starred_url":"https://api.github.com/users/avkhozov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avkhozov/subscriptions","organizations_url":"https://api.github.com/users/avkhozov/orgs","repos_url":"https://api.github.com/users/avkhozov/repos","events_url":"https://api.github.com/users/avkhozov/events{/privacy}","received_events_url":"https://api.github.com/users/avkhozov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-05T13:42:12Z","updated_at":"2015-03-06T23:42:22Z","closed_at":null,"body":"If I use Dumper function from Data::Dumper it's works fine, but with dumper helper it's fail.\r\n\r\n```bash\r\n$ cat 1.pl\r\nuse Mojolicious::Lite;\r\nhook after_build_tx => sub { app->dumper($_[0]) };\r\napp->start;\r\n$ perl 1.pl get '/';\r\nDeep recursion on subroutine \"Mojolicious::build_tx\" at /home/and/perl5/perlbrew/perls/perl-5.20.0/lib/site_perl/5.20.0/Mojolicious.pm line 63, <DATA> line 2231.\r\nDeep recursion on subroutine \"Mojolicious::Plugins::emit_hook\" at /home/and/perl5/perlbrew/perls/perl-5.20.0/lib/site_perl/5.20.0/Mojolicious.pm line 83, <DATA> line 2231.\r\nDeep recursion on anonymous subroutine at /home/and/perl5/perlbrew/perls/perl-5.20.0/lib/site_perl/5.20.0/Mojolicious/Plugins.pm line 11, <DATA> line 2231.\r\nDeep recursion on subroutine \"Mojolicious::AUTOLOAD\" at 1.pl line 3, <DATA> line 2231.\r\nDeep recursion on subroutine \"Mojolicious::build_controller\" at /home/and/perl5/perlbrew/perls/perl-5.20.0/lib/site_perl/5.20.0/Mojolicious.pm line 58, <DATA> line 2231.\r\n^C\r\n$\r\n```"},"comment":{"url":"https://api.github.com/repos/kraih/mojo/issues/comments/77656774","html_url":"https://github.com/kraih/mojo/issues/756#issuecomment-77656774","issue_url":"https://api.github.com/repos/kraih/mojo/issues/756","id":77656774,"user":{"login":"brianmed","id":2425435,"avatar_url":"https://avatars.githubusercontent.com/u/2425435?v=3","gravatar_id":"","url":"https://api.github.com/users/brianmed","html_url":"https://github.com/brianmed","followers_url":"https://api.github.com/users/brianmed/followers","following_url":"https://api.github.com/users/brianmed/following{/other_user}","gists_url":"https://api.github.com/users/brianmed/gists{/gist_id}","starred_url":"https://api.github.com/users/brianmed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brianmed/subscriptions","organizations_url":"https://api.github.com/users/brianmed/orgs","repos_url":"https://api.github.com/users/brianmed/repos","events_url":"https://api.github.com/users/brianmed/events{/privacy}","received_events_url":"https://api.github.com/users/brianmed/received_events","type":"User","site_admin":false},"created_at":"2015-03-06T23:42:22Z","updated_at":"2015-03-06T23:42:22Z","body":"Try something like the code below.\r\n\r\nYour code implicitly calls the after_build_tx hook because the AUTOLOADED \"dumper\" method is invoked via the helpers in a controller.  And, a controller needs an existing $tx object, or to create one.\r\n\r\nMake sense?\r\n\r\n```perl\r\nuse Mojolicious::Lite;\r\n\r\nhook after_build_tx => sub { \r\n    my ($tx, $app) = @_;\r\n\r\n    my $c = $app->build_controller($tx);\r\n\r\n    $c->dumper($_[0]);\r\n};\r\n\r\napp->start;\r\n```"}}