use Config; my $perl = $Config{perlpath}; $perl .= $Config{_exe} if $^O ne 'VMS' and $perl !~ /$Config{_exe}$/i; print "executable is $perl\n";