From: Stas Bekman Date: Thu, 30 May 2002 15:59:48 +0000 (+0800) Subject: $^X X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=38e4f4aed799ac2e3ef36186e997df88f9da92d2;p=p5sagit%2Fp5-mst-13.2.git $^X Message-Id: <3CF5DBF4.7080500@stason.org> p4raw-id: //depot/perl@16872 --- diff --git a/pod/perlvar.pod b/pod/perlvar.pod index 98bd657..13922fe 100644 --- a/pod/perlvar.pod +++ b/pod/perlvar.pod @@ -1150,8 +1150,22 @@ lexical scope. See L. =item $^X -The name that the Perl binary itself was executed as, from C's C. -This may not be a full pathname, nor even necessarily in your path. +The name that the Perl binary itself was executed as, from C's +C. + +This may not be a full pathname, nor even necessarily in your +path. Currently there is no universal solution for this, you may try +to use: + + use Config; + $current_perl_path = (-x $^X) ? $^X : $Config{perlpath}; + +The security-conscious would write: + + use Config; + use File::Spec; + $current_perl_path = (File::Spec->file_name_is_absolute($^X) && -x $^X) + ? $^X : $Config{perlpath}; =item ARGV