use File::Spec; my $lib_path = File::Spec->rel2abs($0); $lib_path =~ s/\/bin\/[\w\d-]+\.pl/lib/; push(@INC,$lib_path);