use IPC::Cmd 'can_run'; my $path = can_run($PRG);