7 posts tagged “perl”
I want to save typing.
use FindBin;
use lib "$FindBin::Bin/../core/lib";
use TypeCore::Bootstrap %param;
I also realize how boring is this post if you're not versed into Perl...
The trick is that TypeCore::Bootstrap is not in @INC by default. I don't really see a way to save much in the above without changing FindBin.
The only thing I could think off is to change that to
use TypeCore::MiniBootstrap core => '..', %param;
and have the following in the new MiniBootstrap:
But now, I need to have this MiniBootstrap available in @INC :( The good thing is that this mini module should be pretty immutable and should work across all versions of TypeCore, but it has to be installed on each machine, or PERL5LIB has to be modified one way or another :/package TypeCore::MiniBootstrap;
sub import {
my $class = shift;
my %param = @_;
my $core = delete $param{core};
my $boot = <<"EOB";
use FindBin;
use lib "\$FindBin::Bin/$core/core/lib";
use TypeCore::Bootstrap %param;
EOB
eval $boot;
}
If one of this name doesn't sound vaguely familiar to you, you can safely skip this post -- Thank you.
If you don't know App::Ack, check it out from CPAN (it's one of the tool I cannot code without).
If you are a vim user, Antoine, did a nifty ingration of both, which let you run ack from vim, and integrates the results in a buffer, then :cnext is your friend.
To mongers out there... anybody knows an elegant way to call SUPER on a dynamic method name?