NAME
Limper::Extending - how to make Limper more useful
VERSION
version 0.009
DESCRIPTION
Limper
is really simple, and meant to have only the features needed. This hopes to show how to extend it and make it more useful in a manageable way.
EXAMPLE
Basic outline of a package that extends Limper
:
package My::Limper::Extension;
use base 'Limper';
use 5.10.0;
use strict;
use warnings;
package Limper;
use Fizz;
use Buzz;
push @Limper::EXPORT, qw/foo/;
push @Limper::EXPORT_OK, qw/bar/;
hook after => sub { ... }
sub bar { ... }
sub foo { ... }
1;
And then in your app:
use 5.10.0;
use strict;
use warnings;
use My::Limper::Extension;
use Limper; # this must come after all extensions
get '/foo' => sub { foo };
limp;
If you also want to be able to send static content, then use Limper::SendFile
as well in your app.
Or you can instead use base 'Limper::SendFile'
instead in My::Limper::Extension
, and don't need to explicitly use it in your app. This gives you the features it adds as well.
COPYRIGHT AND LICENSE
Copyright (C) 2014 by Ashley Willis <ashley+perl@gitable.org>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.12.4 or, at your option, any later version of Perl 5 you may have available.
SEE ALSO
Actual examples: