my $some_path; BEGIN { $some_path = "/my/path"; } use lib "$some_path/lib"; # Yeah, you don't even need the parenthesis, Perl is clever enough for you # Edit : thanks dave_the_m for the correction