Sys::User::UIDhelper - Helps for locating free UIDs using getpwuid.
Version 0.1.0
use Sys::User::UIDhelper; # invokes it with the default values my $foo = Sys::User::UIDhelper->new(); # sets the min to 2000 and the max to 4000 my $foo = Sys::User::UIDhelper->new(min=>2000, max=>4000); # finds the first free one my $first = $foo->firstfree(); if(defined($first)){ print $first."\n"; }else{ print "not found\n"; } # finds the last free one my $last = $foo->lastfree(); if(defined($last)){ print $last."\n"; }else{ print "not found\n"; }
This initiates the module. The following args are accepted.
- min :: The UID to start with. - Default :: 1000 - max :: The last UID in the range to check for. - Default :: 131068
The following is a example showing showing a new instance being created that will start at 2000 and search up to 4000.
my $foo = Sys::User::UIDhelper->new(min=>2000, max=>4000);
If any of the args are non-integers or min is greater than max, it will error.
This finds the first free UID. If it returns undef, no free ones were found.
An alias of firstfree to remain compatible with v. 0.0.1.
This finds the first last UID. If it returns undef, no free ones were found.
An alias of lastfree to remain compatible with v. 0.0.1.
Zane C. Bowers-Hadley, <vvelox at vvelox.net>
<vvelox at vvelox.net>
Please report any bugs or feature requests to bug-sys-user-uidhelper at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Sys-User-UIDhelper. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-sys-user-uidhelper at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Sys::User::UIDhelper
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Sys-User-UIDhelper
Search CPAN
https://metacpan.org/pod/Sys::User::UIDhelper
Copyright 2023 Zane C. Bowers-Hadley, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Sys::User::UIDhelper, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Sys::User::UIDhelper
CPAN shell
perl -MCPAN -e shell install Sys::User::UIDhelper
For more information on module installation, please visit the detailed CPAN module installation guide.