The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Sys::Group::GIDhelper - Helps for locating free GIDs using getgrgid.

VERSION

Version 0.1.0

SYNOPSIS

    use Sys::Group::GIDhelper;

    # invokes it with the default values
    my $foo = Sys::Group::GIDhelper->new();

    # sets the min to 2000 and the max to 4000
    my $foo = Sys::Group::GIDhelper->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";
    }

METHODS

new

This initiates the module. The following args are accepted.

    - min :: The GID to start with.
        - Default :: 1000

    - max :: The last GID 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::Group::GIDhelper->new(min=>2000, max=>4000);

If any of the args are non-integers or min is greater than max, it will error.

first_free

This finds the first free GID. If it returns undef, no free ones were found.

firstfree

An alias of firstfree to remain compatible with v. 0.0.2.

lastfree

This finds the first last UID. If it returns undef, no free ones were found.

lastfree

An alias of lastfree to remain compatible with v. 0.0.1.

AUTHOR

Zane C. Bowers-Hadley, <vvelox at vvelox.net>

BUGS

Please report any bugs or feature requests to bug-sys-group-gidhelper at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Sys-Group-UIDhelper. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Sys::Group::GIDhelper

You can also look for information at:

ACKNOWLEDGEMENTS

COPYRIGHT & LICENSE

Copyright 2023 Zane C. Bowers, all rights reserved.

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