Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Determining real name from login name

by zejames (Hermit)
on Nov 30, 2004 at 13:58 UTC ( #411183=note: print w/replies, xml ) Need Help??


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 (Chancellor) 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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://411183]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2020-10-29 01:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (265 votes). Check out past polls.

    Notices?