shorter shorter shorter...
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;
}
Comments
Too bad FindBin doesn't allow something like:
which would automatically prepend $Bin and do a 'use lib' with the resulting path.