Last active
July 7, 2017 23:36
-
-
Save melo/48d9b6fd5cecff24bd296f8ecbef1025 to your computer and use it in GitHub Desktop.
Perl setup
This file contains hidden or 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
package MyClass; | |
use MySetup; | |
use Function::Parameters (); | |
use Moo (); | |
use namespace::sweep (); | |
use Scalar::Util (); | |
use Try::Tiny (); | |
use Import::Into; | |
sub import { | |
my $pkg = caller; | |
Function::Parameters->import({ func => 'function', method => 'method' }); | |
Scalar::Util->import::into($pkg, qw(blessed)); | |
Try::Tiny->import::into($pkg); | |
namespace::sweep->import(-cleanee => $pkg); | |
Moo->import::into($pkg); | |
goto &MySetup::import; | |
} | |
sub unimport { | |
splice(@_, 0, 1, 'Moo'); | |
goto \&Moo::unimport; | |
} | |
1; |
This file contains hidden or 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
package MySetup; | |
use 5.014; | |
use strict (); | |
use warnings (); | |
use utf8 (); | |
use feature (); | |
use experimental (); | |
sub import { | |
warnings->import(); | |
strict->import(); | |
utf8->import(); | |
feature->import(':5.14'); | |
experimental->import('switch'); | |
} | |
1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment