Use gist.github.com
That is all.
Its very easy, its hosted by Github.
I like git.
A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.
Jump to
Guide to debugging Mojolicious applications
When MOJO_MODE=development or is not set, you should see exceptions rendered in the browser. But if you don't, try creating a templates/exception.html.ep template that contains this: %= $exception
You can also create error templates for different environments:
Mojo provides useful hooks that can be used to dump out debugging info:
You can also create error templates for different environments:
- templates/exception.production.html.ep
- templates/exception.development.html.ep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# DEBUGGING HACK | |
$t->app->hook(before_dispatch => sub { # for request | |
my $c = shift; | |
return unless $ENV{APP_DEBUG}; | |
print "*** Request body = ".$c->tx->req->body."\n"; | |
print "*** Request headers = ".$c->tx->req->content->headers->to_string."\n"; | |
print "*** End of headers\n"; | |
}); | |
$t->app->hook(after_dispatch => sub { # for response | |
my $c = shift; | |
return unless $ENV{APP_DEBUG}; | |
print "*** Response body = ".$c->tx->res->body."\n"; | |
print "*** Response headers = ".$c->tx->res->content->headers->to_string."\n"; | |
print "*** End of headers\n"; | |
}); | |
#/ DEBUGGING HACK |
How to use local::lib to install Perl modules locally
First:
cd project_dir
eval $( perl -Mlocal::lib=local )
Install dependencies:
cpanm -L local --installdeps .
cd project_dir
eval $( perl -Mlocal::lib=local )
Install dependencies:
cpanm -L local --installdeps .
Or individual modules:
cpanm -L local Some::Module
Subscribe to:
Posts (Atom)