http://www.perlmonks.org?node_id=411183


in reply to Determining real name from login name

You can use Unix::PasswdFile :
use Unix::PasswdFile; $pw = new Unix::PasswdFile "/etc/passwd"; my $realname = $pw->gecos("toto");

HTH

--
zejames

Replies are listed 'Best First'.
Re^2: Determining real name from login name
by Fletch (Bishop) on Nov 30, 2004 at 14:17 UTC

    And then you move to a system using NIS/YP or LDAP and wonder why your script breaks . . . . getpwuid() and friends work just fine and are core; no need for an extra module.

    A reply falls below the community's threshold of quality. You may see it by logging in.