This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Cleanup utf8_heavy; allow dropping the In prefix from
[perl5.git] / lib / filetest.pm
index fe1777e..21252f3 100644 (file)
@@ -1,11 +1,13 @@
 package filetest;
 
+our $VERSION = '1.00';
+
 =head1 NAME
 
 filetest - Perl pragma to control the filetest permission operators
 
 =head1 SYNOPSIS
-    
+
     $can_perhaps_read = -r "file";     # use the mode bits
     {
         use filetest 'access';         # intuit harder
@@ -32,7 +34,7 @@ There may be a slight performance decrease in the filetests
 when C<use filetest> is in effect, because in some systems
 the extended functionality needs to be emulated.
 
-B<NOTE>: using the file tests for security purposes is a lost case
+B<NOTE>: using the file tests for security purposes is a lost cause
 from the start: there is a window open for race conditions (who is to
 say that the permissions will not change between the test and the real
 operation?).  Therefore if you are serious about security, just try
@@ -47,9 +49,11 @@ operators is a filename, not when it is a filehandle.
 
 =cut
 
+$filetest::hint_bits = 0x00400000;
+
 sub import {
     if ( $_[1] eq 'access' ) {
-       $^H |= 0x00400000;
+       $^H |= $filetest::hint_bits;
     } else {
        die "filetest: the only implemented subpragma is 'access'.\n";
     }
@@ -57,7 +61,7 @@ sub import {
 
 sub unimport {
     if ( $_[1] eq 'access' ) {
-       $^H &= ~0x00400000;
+       $^H &= ~$filetest::hint_bits;
     } else {
        die "filetest: the only implemented subpragma is 'access'.\n";
     }