develooper Front page | perl.perl5.porters | Postings from May 2002

[PATCH pod/perlvar.pod] $^X

Thread Next
From:
Stas Bekman
Date:
May 30, 2002 00:59
Subject:
[PATCH pod/perlvar.pod] $^X
Message ID:
3CF5DBF4.7080500@stason.org
Based on email from Ilya Zakharevich to module-authors@perl.org

[attached and inlined]

+++ pod/perlvar.pod	2002-05-30 15:55:39.000000000 +0800
@@ -1150,8 +1150,22 @@

  =item $^X

-The name that the Perl binary itself was executed as, from C's C<argv[0]>.
-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<argv[0]>.
+
+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



__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About