Genders(3)
β¨ Genders β bestie edition β¨
okay so this is the Genders perl library, and it's literally a perl interface for querying a genders file. that's it, that's the vibe. it's a User Contributed Perl Documentation page, section 3 of the manual, and honestly? she ate. π
π SYNOPSIS π
here's the whole menu of what you can call, no cap:
use Genders;
$Genders::GENDERS_DEFAULT_FILE;
$obj = Genders->new([$filename])
$obj->debug($num)
$obj->getnodename()
$obj->getnodes([$attr, [$val]])
$obj->getattr([$node])
$obj->getattr_all()
$obj->getattrval($attr, [$node])
$obj->testattr($attr, [$node])
$obj->testattrval($attr, $val, [$node])
$obj->isnode([$node])
$obj->isattr($attr)
$obj->isattrval($attr, $val)
$obj->index_attrvals($attr)
$obj->query($query)
$obj->testquery($query, [$node])
π¦ DESCRIPTION π¦
so this package gives you a perl interface for querying a genders file. periodt. let's go through every single method one by one because we are not skipping anything in this house π
Genders->new([$filename])β makes a Genders object and loads genders data from the file you named. if you don't specify a genders file, the default genders file gets used instead. and heads up: it returnsundefif the file can't be read. π$obj->debug($num)β sets the debug level on the genders object. default is0and that means all debugging is off. wanna turn it on? set the level to1. simple as.$obj->getnodename()β returns the name of the current node. main character identification, honestly π$obj->getnodes([$attr, [$val]])β returns a list of nodes that have the attribute and value you specified. if you don't give a value, only the attribute is considered. if you don't give an attribute at all, you get all the nodes listed in the genders file. generous queen.$obj->getattr([$node])β returns a list of attributes for the node you specified. if you don't specify a node, the local node's attributes get returned instead.$obj->getattr_all()β returns a list of all attributes listed in the genders file. the full collection, no filter β¨$obj->getattrval($attr, [$node])β returns the value of the specified attribute for the specified node. if the attribute doesn't exist, or the attribute has no value, you get an empty string back. and if you don't specify the node, the local node's attribute value is returned.$obj->testattr($attr, [$node])β returns1if the specified node has the specified attribute,0if it doesn't. if you don't specify a node, the local node gets checked.$obj->testattrval($attr, $val, [$node])β returns1if the specified node has the specified attribute and value,0if it doesn't. no node specified? local node gets checked.$obj->isnode([$node])β returns1if the specified node is listed in the genders file,0if it's not. no node specified? you already know β local node gets checked.$obj->isattr($attr)β returns1if the specified attribute is listed in the genders file,0if it's not.$obj->isattrval($attr, $val)β returns1if the specified attribute is equal to the specified value for some node in the genders file,0if it's not.$obj->index_attrvals($attr)β internally indexes genders attribute values so searches go faster. lowkey a glow-up for your query speed. just know that subsequent calls with a different attribute will overwrite earlier indexes, so don't come crying when your old index is gone π$obj->query($query)β returns a list of nodes specified by a genders query. a genders query is based on the union, intersection, set difference, or complement between genders attributes and values. here's the cheat sheet:- union = two pipe symbols (
'||') - intersection = two ampersand symbols (
'&&') - difference = two minus symbols (
'--') - complement = a tilde (
'~')
- union = two pipe symbols (
operations are performed from left to right. parentheses may be used to change the order of operations. for example, this query would retrieve all nodes other than management or login nodes: "~(mgmt||login)". and if the query isn't specified, all nodes listed in the genders file are returned. iconic default behaviour fr fr.
$obj->testquery($query, [$node])β returns1if the specified node meets the conditions of the specified query,0if it doesn't. no node specified? yeah babe, local node gets checked.
π AUTHOR π
Albert Chu <chu11@llnl.gov> β we stan a legend π«Ά
π SEE ALSO π
- Libgenders.
- libgenders.
π quick reminder bestie: all the file reading, undef returns, overwritten indexes and left-to-right query evaluation are real and they will humble you if you ignore them. the vibe is cute, the semantics are not negotiable.
and that's the page, babes π this was perl v5.10.1, dated 2013-08-02, Genders(3) β mwah, slay, periodt. go query something πΈ
π¦ where this page comes from
- debian trixie: libgenders-perl 1.27-3-3.1
- ubuntu questing: libgenders-perl 1.27-3-3.1
- ubuntu resolute: libgenders-perl 1.27-3-3.2
- ubuntu stonking: libgenders-perl 1.27-3-3.2build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms