my $ppt_bin = defined $ENV{PAR_TEMP} ? "$ENV{PAR_TEMP}/inc/script" : dirname(abs_path($0)); ... my $file = "$ppt_bin/$tool"; $0 = $tool; # for usage/warning/error messages my $return = do $file;