in reply to stat & uid

Perl has a bunch of the same functions that are in the system library. See the "Fetching user and group info" of perldoc perlfunc, specifically perldoc -f getpwuid