The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Util::User::Switch - Become a user by Setting uid/gid or invoking sudo

VERSION

This documentation describes version 0.01

SYNOPSIS

 use Util::User::Switch;

 my ( $uid, $gid ) = Util::User::Switch->setuidgid( 'joe' );

 Util::User::Switch->sudo( 'root' );

DESCRIPTION

setuidgid( user )

(As superuser) sets uid, gid, effective uid, and effective gid as those of 'user'. Returns an the uid and gid of the target user in list context, or an ARRAY reference in scalar context.

sudo( user )

Invokes system sudo. Becomes 'root' if user is not specified.

AUTHOR

Kan Liu

COPYRIGHT and LICENSE

Copyright (c) 2010. Kan Liu

This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.