# also untested use Path::Tiny qw /path/; use FindBin qw /$Bin/; my $exe_name = 'some_exe'; my $exe_path; if ($ENV{PAR_0}) { # running under PAR - look for the unpacked exe file $exe_path = path ($ENV{PAR_TEMP}, 'inc', $exe_name)->stringify; } else { # not running under par, assume file is adjacent $exe_path = path( $Bin, $exe_name )->stringify; } # set the env var $ENV{GLOBAL_PAR_TEMP} = 'C:\some\path'; # now run it # maybe use exec or wrap it in Capture::Tiny::capture system $exe_path, @ARGV;