/usr/share/perl5
NameSizeModeActions
App/-0755rm
Archive/-0755rm
Attribute/-0755rm
autodie/-0755rm
B/-0755rm
Carp/-0755rm
CGI/-0755rm
Class/-0755rm
Config/-0755rm
CPAN/-0755rm
CPANPLUS/-0755rm
DBIx/-0755rm
DBM_Filter/-0755rm
Devel/-0755rm
Digest/-0755rm
Encode/-0755rm
encoding/-0755rm
Exporter/-0755rm
ExtUtils/-0755rm
File/-0755rm
Filter/-0755rm
Getopt/-0755rm
HTML/-0755rm
I18N/-0755rm
IO/-0755rm
IPC/-0755rm
JSON/-0755rm
Locale/-0755rm
Log/-0755rm
Math/-0755rm
Memoize/-0755rm
Module/-0755rm
Net/-0755rm
Object/-0755rm
overload/-0755rm
Package/-0755rm
Params/-0755rm
Parse/-0755rm
PerlIO/-0755rm
Pod/-0755rm
pod/-0755rm
Search/-0755rm
TAP/-0755rm
Term/-0755rm
Test/-0755rm
Test2/-0755rm
Text/-0755rm
Thread/-0755rm
Tie/-0755rm
Time/-0755rm
Unicode/-0755rm
unicore/-0755rm
URI/-0755rm
User/-0755rm
vendor_perl/-0755rm
version/-0755rm
warnings/-0755rm
abbrev.pl8380644editdlrm
AnyDBM_File.pm25940644editdlrm
assert.pl12980644editdlrm
attributes.pm148770644editdlrm
autodie.pm117630644editdlrm
AutoLoader.pm149970644editdlrm
AutoSplit.pm196370644editdlrm
autouse.pm42380644editdlrm
base.pm69860644editdlrm
Benchmark.pm285300644editdlrm
bigfloat.pl73680644editdlrm
bigint.pl89590644editdlrm
bigint.pm178520644editdlrm
bignum.pm186730644editdlrm
bigrat.pl44760644editdlrm
bigrat.pm144420644editdlrm
blib.pm21060644editdlrm
bytes.pm23840644editdlrm
bytes_heavy.pl7580644editdlrm
cacheout.pl11220644editdlrm
Carp.pm76110644editdlrm
CGI.pm2614780644editdlrm
charnames.pm156700644editdlrm
complete.pl31910644editdlrm
constant.pm125280644editdlrm
CORE.pod15690644editdlrm
CPAN.pm1309070644editdlrm
CPANPLUS.pm72690644editdlrm
ctime.pl19930644editdlrm
DB.pm192020644editdlrm
DBM_Filter.pm144150644editdlrm
diagnostics.pm173800644editdlrm
Digest.pm104120644editdlrm
DirHandle.pm19370644editdlrm
dotsh.pl21750644editdlrm
Dumpvalue.pm168990644editdlrm
dumpvar.pl152750644editdlrm
English.pm44880644editdlrm
Env.pm51700644editdlrm
exceptions.pl17360644editdlrm
Expect.pm547250644editdlrm
Expect.pod437350644editdlrm
Exporter.pm185950644editdlrm
fastcwd.pl10190644editdlrm
Fatal.pm409660644editdlrm
feature.pm50920644editdlrm
fields.pm95070644editdlrm
FileCache.pm55700644editdlrm
FileHandle.pm67780644editdlrm
filetest.pm40030644editdlrm
find.pl11850644editdlrm
FindBin.pm56580644editdlrm
finddepth.pl11300644editdlrm
flush.pl6420644editdlrm
getcwd.pl14270644editdlrm
getopt.pl13220644editdlrm
getopts.pl14060644editdlrm
hostname.pl7270644editdlrm
if.pm11660644editdlrm
importenv.pl2830644editdlrm
integer.pm32660644editdlrm
less.pm30840644editdlrm
locale.pm8200644editdlrm
look.pl12550644editdlrm
Memoize.pm352950644editdlrm
newgetopt.pl22130644editdlrm
NEXT.pm184810644editdlrm
ok.pm9670444editdlrm
open.pm77400644editdlrm
open2.pl1850644editdlrm
open3.pl1850644editdlrm
overload.pm480500644editdlrm
overloading.pm18010644editdlrm
parent.pm29980644editdlrm
perl5db.pl3176820644editdlrm
PerlIO.pm111220644editdlrm
pwd.pl14780644editdlrm
Safe.pm243260644editdlrm
SelectSaver.pm10760644editdlrm
SelfLoader.pm173410644editdlrm
Shell.pm86850644editdlrm
shellwords.pl2760644editdlrm
sigtrap.pm76110644editdlrm
sort.pm60930644editdlrm
stat.pl5900644editdlrm
strict.pm37160644editdlrm
subs.pm8420644editdlrm
Switch.pm285080644editdlrm
Symbol.pm47940644editdlrm
syslog.pl48060644editdlrm
tainted.pl1640644editdlrm
termcap.pl41140644editdlrm
Test.pm288000644editdlrm
Test2.pm63930444editdlrm
Thread.pm82850644editdlrm
timelocal.pl6900644editdlrm
UNIVERSAL.pm65360644editdlrm
utf8.pm69180644editdlrm
utf8_heavy.pl80010644editdlrm
validate.pl37310644editdlrm
vars.pm23580644editdlrm
version.pm10370644editdlrm
version.pod123150644editdlrm
vmsish.pm43280644editdlrm
warnings.pm161330644editdlrm
Edit: /usr/share/perl5/filetest.pm (4003B)
package filetest; our $VERSION = '1.02'; =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 $can_really_read = -r "file"; } $can_perhaps_read = -r "file"; # use the mode bits again =head1 DESCRIPTION This pragma tells the compiler to change the behaviour of the filetest permission operators, C<-r> C<-w> C<-x> C<-R> C<-W> C<-X> (see L). The default behaviour of file test operators is to use the simple mode bits as returned by the stat() family of system calls. However, many operating systems have additional features to define more complex access rights, for example ACLs (Access Control Lists). For such environments, C may help the permission operators to return results more consistent with other tools. The C or C statements affect file tests defined in their block, up to the end of the closest enclosing block (they are lexically block-scoped). Currently, only the C sub-pragma is implemented. It enables (or disables) the use of access() when available, that is, on most UNIX systems and other POSIX environments. See details below. =head2 Consider this carefully The stat() mode bits are probably right for most of the files and directories found on your system, because few people want to use the additional features offered by access(). But you may encounter surprises if your program runs on a system that uses ACLs, since the stat() information won't reflect the actual permissions. There may be a slight performance decrease in the filetest operations when the filetest pragma is in effect, because checking bits is very cheap. Also, note that 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 the real operation and test for its success - think in terms of atomic operations. Filetests are more useful for filesystem administrative tasks, when you have no need for the content of the elements on disk. =head2 The "access" sub-pragma UNIX and POSIX systems provide an abstract access() operating system call, which should be used to query the read, write, and execute rights. This function hides various distinct approaches in additional operating system specific security features, like Access Control Lists (ACLs) The extended filetest functionality is used by Perl only when the argument of the operators is a filename, not when it is a filehandle. =head2 Limitation with regard to C<_> Because access() does not invoke stat() (at least not in a way visible to Perl), B. This means that the outcome of the following two tests is different. The first has the stat bits of C in C<_>, and in the second case this still contains the bits of C. { -d '/etc'; -w '/etc/passwd'; print -f _ ? 'Yes' : 'No'; # Yes } { use filetest 'access'; -d '/etc'; -w '/etc/passwd'; print -f _ ? 'Yes' : 'No'; # No } Of course, unless your OS does not implement access(), in which case the pragma is simply ignored. Best not to use C<_> at all in a file where the filetest pragma is active! As a side effect, as C<_> doesn't work, stacked filetest operators (C<-f -w $file>) won't work either. This limitation might be removed in a future version of perl. =cut $filetest::hint_bits = 0x00400000; # HINT_FILETEST_ACCESS sub import { if ( $_[1] eq 'access' ) { $^H |= $filetest::hint_bits; } else { die "filetest: the only implemented subpragma is 'access'.\n"; } } sub unimport { if ( $_[1] eq 'access' ) { $^H &= ~$filetest::hint_bits; } else { die "filetest: the only implemented subpragma is 'access'.\n"; } } 1;