$^X
[p5sagit/p5-mst-13.2.git] / pod / perlvar.pod
index 1e6350b..13922fe 100644 (file)
@@ -663,8 +663,11 @@ Also see L<Error Indicators>.
 
 =item ${^ENCODING}
 
-The encoding used to interpret native eight-bit encodings to Unicode,
-see L<encode>.  An opaque C<Encode::XS> object.
+The I<object reference> to the Encode object that is used to convert
+the source code to Unicode.  Thanks to this variable your perl script
+does not have to be written in UTF-8.  Default is I<undef>.  The direct
+manipulation of this variable is highly discouraged.  See L<encoding>
+for more details.
 
 =item $OS_ERROR
 
@@ -700,6 +703,18 @@ went bang?)
 
 Also see L<Error Indicators>.
 
+=item %!
+
+Each element of C<%!> has a true value only if C<$!> is set to that
+value.  For example, C<$!{ENOENT}> is true if and only if the current
+value of C<$!> is C<ENOENT>; that is, if the most recent error was
+"No such file or directory" (or its moral equivalent: not all operating
+systems give that exact error, and certainly not all languages).
+To check if a particular key is meaningful on your system, use
+C<exists $!{the_key}>; for a list of legal keys, use C<keys %!>.
+See L<Errno> for more information, and also see above for the
+validity of C<$!>.
+
 =item $EXTENDED_OS_ERROR
 
 =item $^E
@@ -1135,8 +1150,22 @@ lexical scope.  See L<bytes>.
 
 =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
 
@@ -1416,7 +1445,7 @@ expression matches in a program, regardless of whether they occur
 in the scope of C<use English>.  For that reason, saying C<use
 English> in libraries is strongly discouraged.  See the
 Devel::SawAmpersand module documentation from CPAN
-(http://www.cpan.org/modules/by-module/Devel/)
+( http://www.cpan.org/modules/by-module/Devel/ )
 for more information.
 
 Having to even think about the C<$^S> variable in your exception