I've grouped these because they all basically do the same thing: they map an obtuse, list returning core function to a structure with named fields. None of these do anything that the core functions under them don't do, but they make for much, much more readable code:
use Time::localtime; printf "Year is %d\n", localtime->year() + 1900; $now = ctime(); use Time::localtime; use File::stat; $date_string = ctime( stat( $file )->mtime );
Fields: sec, min, hour, mday, mon, year, wday, yday, and isdst
Fields: dev, ino, mode, nlink, uid, gid, rdev, size, atime, mtime, ctime, blksize, and block
...caveat...
use User::pwent; $pw = getpwnam('daemon') || die "No daemon user"; if ( $pw->uid == 1 && $pw->dir =~ m#^/(bin|tmp)?\z#s ) { print "gid 1 on root dir"; }
Fields: name, passwd, uid, gid, change, age, quota, comment, class, gecos, dir, shell, and expire
use User::grent; $gr = getgrgid(0) or die "No group zero"; if ( $gr->name eq 'wheel' && @{$gr->members} > 1 ) { print "gid zero name wheel, with other members"; }
Fields: name, passwd, gid, and members