http://www.perlmonks.org?node_id=1096144


in reply to Calculations before using lib;

To call the code during the compilation phase when use is resolved, use the BEGIN block:
use FindBin qw($Bin); my $dir; BEGIN { if ($Bin =~ /^(\/.+\/monkeyman\/bin)(\/.+)?/) { $dir = "$1/lib"; } use lib $dir; use MonkeyMan;

See perlsub for details.

لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ