- or download this
$mode = (stat($filename))[2];
printf "Permissions are %04o\n", $mode &07777;
- or download this
my $mode = (stat($file))[2];
my $perms = sprintf "%04o", $mode &07777;
print "EVIL PERSON with $file" if $perms eq '0777';
- or download this
use Fcntl ':mode';
$mode = (stat($filename))[2];
$user_rwx = ($mode & S_IRWXU) >> 6;