1N/A# Class::Struct forbids use of @ISA 1N/AUser::grent - by-name interface to Perl's built-in getgr*() functions 1N/A $gr = getgrgid(0) or die "No group zero"; 1N/A if ( $gr->name eq 'wheel' && @{$gr->members} > 1 ) { 1N/A print "gid zero name wheel, with other members"; 1N/A use User::grent qw(:FIELDS; 1N/A getgrgid(0) or die "No group zero"; 1N/A if ( $gr_name eq 'wheel' && @gr_members > 1 ) { 1N/A print "gid zero name wheel, with other members"; 1N/A $gr = getgr($whoever); 1N/AThis module's default exports override the core getgrent(), getgruid(), 1N/Aand getgrnam() functions, replacing them with versions that return 1N/A"User::grent" objects. This object has methods that return the similarly 1N/Anamed structure field name from the C's passwd structure from F<grp.h>; 1N/Anamely name, passwd, gid, and members (not mem). The first three 1N/Areturn scalars, the last an array reference. 1N/AYou may also import all the structure fields directly into your namespace 1N/Aas regular variables using the :FIELDS import tag. (Note that this still 1N/Aoverrides your core functions.) Access these fields as variables named 1N/Awith a preceding C<gr_>. Thus, C<$group_obj-E<gt>gid()> corresponds 1N/Ato $gr_gid if you import the fields. Array references are available as 1N/Aregular array variables, so C<@{ $group_obj-E<gt>members() }> would be 1N/AThe getpw() function is a simple front-end that forwards 1N/Aa numeric argument to getpwuid() and the rest to getpwnam(). 1N/ATo access this functionality without the core overrides, 1N/Apass the C<use> an empty import list, and then access 1N/Afunction functions with their full qualified names. 1N/AOn the other hand, the built-ins are still available 1N/Avia the C<CORE::> pseudo-package. 1N/AWhile this class is currently implemented using the Class::Struct 1N/Amodule to build a struct-like class, you shouldn't rely upon this.