<p>Perl has several built-in functions for accessing /etc/passwd on Unix systems (and elsewhere when supported) for user and group information. For instance,</p>

<pre><code>my $name = getpwuid($uid);
</code></pre>

<p>will return the user name given the user ID, or undef if there is no such user.</p>

<p>If a Perl script needs to be portable and run on Unices and Windows, how should one access user and group information? ActivePerl seems to support User::grent and User::pwent modules, which provide by-field access to /etc/passwd -- even in Windows. Curiously they do not support the built-in functions getpw* and getgr*. What other alternatives are there?</p>

You could use the
```
Win32::NetAdmin
```
module
.
```
UserGetAttributes
```
and
```
GroupIsMember
```
look like they do what you need.