Last active
December 22, 2015 08:48
-
-
Save yappo/6447138 to your computer and use it in GitHub Desktop.
smart script
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
requires 'Acme::Hidek' => '43'; |
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
#!/usr/bin/env perl | |
use strict; | |
use warnings FATAL => 'all'; | |
use utf8; | |
use lib; | |
use Config; | |
use Cwd 'getcwd'; | |
use File::Spec; | |
use FindBin; | |
BEGIN { | |
my $carton_version = `carton -v`; | |
die 'please install carton 1.0.0 higher' if !$carton_version || $carton_version =~ /\Av0\./; | |
my $cwd = getcwd(); | |
chdir $FindBin::Bin; | |
!system 'carton', 'install' or die $; | |
!system 'carton', 'check' or die $?; | |
chdir $cwd; | |
@INC = @Config{qw(privlibexp archlibexp)}; # same as a lib::core::only | |
lib->import( | |
File::Spec->catfile($FindBin::Bin, 'lib'), | |
File::Spec->catfile($FindBin::Bin, 'local', 'lib', 'perl5') | |
); | |
} | |
# write your awesome code! | |
use Acme::Hidek; | |
my $hidek = Acme::Hidek->new(); | |
$hidek->we_love_hidek; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment