X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Ffiletest.pm;h=21252f35a6fc1322eda6f7f32d76d773ed4a6744;hb=e2be6f076cc59730d8ec4f9a3cbe716348da62de;hp=65fc1704f03251e9f028156865e720a76510a575;hpb=6ca796d8ae94908bbc34cd873f81a4bfacef7c12;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/filetest.pm b/lib/filetest.pm index 65fc170..21252f3 100644 --- a/lib/filetest.pm +++ b/lib/filetest.pm @@ -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 @@ -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"; }