Text::...Object(3pm)
π Text::DHCPLeases::Object β the Leases Object Class π
okay bestie, gather round, because this is the Text::DHCPLeases::Object page from the User Contributed Perl Documentation (yep, that's the manual we're in) and it's literally the little object that holds one DHCP lease's whole personality. π
β¨ NAME β¨
Text::DHCPLeases::Object β the Leases Object Class. that's it, that's the name, she's iconic and she knows it. π
πΈ SYNOPSIS πΈ
the two ways to summon her:
my $obj = Text::DHCPLeases::Object->parse($string);
or
my $obj = Text::DHCPLeases::Object->new(%lease_data);
and then you can just... ask her things:
print $obj->name; print $obj->type; print $obj->binding_state;
no cap, that's the whole vibe check. β¨
π¦ DESCRIPTION π¦
so the DHCPLeases object class is the main character here, and a lease object can be one of the following types β lowkey it's a whole friend group:
lease
host
group
subgroup
failover-state
pick your fighter, she contains multitudes. π
π CLASS METHODS π
π« new - Constructor π«
the constructor!! the birth of a lease object, we love to see it. π«Ά
Arguments:
typeβ one of(lease|host|group|subgroup|failover-state)nameβ the identification string (address, host name, group name, etc)ip_addressfixed_addressstartsendststptsfpatsfpclttnext_binding_statebinding_stateuidclient_hostnameabandonedβ (flag)deletedβ (flag)dynamic_bootpβ (flag)dynamicβ (flag)option_agent_circuit_idoption_agent_remote_idhardware_typemac_addresssetβ (hash)onβ (hash)bootpβ (flag)reservedβ (flag)my_statemy_state_datepartner_statepartner_state_datemcltdns_rev_nameddns_fwd_nameddns_txt
Returns:
- a brand new
Text::DHCPLeases::Objectobject π
Examples:
my $lease = Text::DHCPLeases::Object->new(type => 'lease',
ip_address => '192.168.1.10',
starts => '3 2007/08/15 11:34:58',
ends => '3 2007/08/15 11:44:58');
π§ parse - Parse object declaration π§
this one takes a raw declaration and turns it into structured data. it's giving translator, it's giving interpreter energy. β¨
Arguments:
- Array ref with declaration lines
Returns:
- Hash reference.
Examples:
my $text = '
lease 192.168.254.55 {
starts 3 2007/08/15 11:34:58;
ends 3 2007/08/15 11:44:58;
tstp 3 2007/08/15 11:49:58;
tsfp 2 2007/08/14 21:24:19;
cltt 3 2007/08/15 11:34:58;
binding state active;
next binding state expired;
hardware ethernet 00:11:85:5d:4e:11;
uid "\001\000\021\205]Nh";
client-hostname "blah";
}';
my $lease_data = Text::DHCPLeases::Lease->parse($text);
π INSTANCE METHODS π
π print - Print formatted string with lease contents π
she prints herself. formatted. gorgeous. no notes. π₯
Arguments:
- None
Returns:
- Formatted String
Examples:
print $obj->print;
π AUTHOR π
Carlos Vicente <cvicente@cpan.org> β the legend, the blueprint, the moment. π
π LICENCE AND COPYRIGHT π
Copyright (c) 2012, Carlos Vicente <cvicente@cpan.org>. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.
so like, go forth and remix it, bestie, just respect the terms. πΈ
π DISCLAIMER OF WARRANTY π
okay this part is ALL CAPS for a reason and I'm not softening it, because it genuinely matters. the legal girlies wrote this and it is what it is:
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
fr fr, it's "AS IS", so test your stuff before you ship it. π
and that's the page!! π this manual shipped with perl v5.36.0, dated 2023-01-22, and it lives at Text::...Object(3pm) in the User Contributed Perl Documentation β so if you're reading it, you're exactly where you're supposed to be. mwah, go parse some leases, bestie. πβ¨π¦
π¦ where this page comes from
- debian bookworm: libtext-dhcpleases-perl 1.0-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libtext-dhcpleases-perl 1.0-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libtext-dhcpleases-perl 1.0-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libtext-dhcpleases-perl 1.0-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libtext-dhcpleases-perl 1.0-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms