in reply to FileMask Conversion
$permish = 0751; # as returned by stat $b = 01000; ($p = "rwxrwxrwx") =~ s/(.)/($b>>=1)&$permish ? $1 : '-'/ge; print "$p\n"; [download]
This doesn't cope with setuid bits, mind you.