Unix-Mgt

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN


    Unix::Mgt::User objects stringify to the account's name. For example,
    the following code would output miko.

     $user = Unix::Mgt::User->get('miko');
     print $user, "\n";

 get

    Unix::Mgt::User->get() retrieves user account information using
    getpwnam or getpwuid. The single param for this method is either the
    name or the uid of the user.

     $user = Unix::Mgt::User->get('vera');
     $user = Unix::Mgt::User->get('1010');

    If the user is not found then the do-not-have-user error id is set in
    $Unix::Mgt::err_id and undef is returned.

 create

lib/Unix/Mgt.pm  view on Meta::CPAN




#------------------------------------------------------------------------------
# get
#

=head2 get

Unix::Mgt::User->get() retrieves user account information using C<getpwnam> or
C<getpwuid>.  The single param for this method is either the name or the uid of
the user.

 $user = Unix::Mgt::User->get('vera');
 $user = Unix::Mgt::User->get('1010');

If the user is not found then the C<do-not-have-user> error id is set in
C<$Unix::Mgt::err_id> and undef is returned.

=cut

lib/Unix/Mgt.pm  view on Meta::CPAN

# fields
#
sub fields {
	my ($class, $name) = @_;
	
	# TESTING
	# println subname(method=>1); ##i
	
	# return
	if ($name =~ m|^\d+$|s)
		{ return getpwuid($name) }
	else
		{ return getpwnam($name) }
}
#
# fields
#------------------------------------------------------------------------------


#------------------------------------------------------------------------------
# create

lib/Unix/Mgt.pod  view on Meta::CPAN


Unix::Mgt::User objects stringify to the account's name. For example, the
following code would output C<miko>.

 $user = Unix::Mgt::User->get('miko');
 print $user, "\n";

=head2 get

Unix::Mgt::User->get() retrieves user account information using C<getpwnam> or
C<getpwuid>.  The single param for this method is either the name or the uid of
the user.

 $user = Unix::Mgt::User->get('vera');
 $user = Unix::Mgt::User->get('1010');

If the user is not found then the C<do-not-have-user> error id is set in
C<$Unix::Mgt::err_id> and undef is returned.

=head2 create



( run in 0.373 second using v1.01-cache-2.11-cpan-8d75d55dd25 )