GO::Utils(3pm)
π GO::Utils(3pm) π
okay bestie, welcome to GO::Utils β the lil grab-bag of utility functions for GO modules β¨ it ships as part of the User Contributed Perl Documentation, and honestly? it's giving "toolbox that just works." no cap.
πΈ NAME πΈ
GO::Utils β utilities for GO modules π§°π
β¨ DESCRIPTION β¨
it's a collection of helper subs, that's the vibe. let's go through them one by one, bestie π«Ά
π rearrange()
- Usage β n/a
- Function β rearranges named parameters into the order you requested π
- Returns β
@params, an array of parameters in the requested order - Argument β
$order: a reference to an array that describes the desired order of the named parameters. And@param: an array of parameters β either as a plain list (in which case the function simply returns the list, no drama), or as an associative array (in which case the function sorts the values according to@{$order}and hands you back that new array π) - Exceptions β
carpsif a non-recognised parameter gets sent in π
π¦ get_param()
- Usage β
get_param('name',(-att1=>'ben',-name=>'the_name')) - Function β fetches a named parameter π
- Returns β the value of the requested parameter
- Argument β
$name: the name of the the parameter desired. And@param: an array of parameters, as an associative array - Exceptions β
carpsif a non-recognised parameter gets sent in π
this one is based on rearrange(), which originally came from CGI.pm by Lincoln Stein and BioPerl by Richard Resnick π see rearrange() for the details, iykyk.
π remove_duplicates
removes duplicate items from an array, bestie β decluttering but for data π§Ήβ¨
- usage β
remove_duplicates(\@arr)
heads up: it affects the array passed in, and returns the modified array. so it's not a copy situation, it's an in-place glow-up π
π merge_hashes
joins two hashes together π«
- usage β
merge_hashes(\%h1, \%h2);
%h1 will now contain the key/val pairs of %h2 as well. and if there are key conflicts? %h2 values take precedence. periodt π
π get_method_ref
returns a pointer to a particular object's method π― like:
my $length_f = get_method_ref($seq, 'length');
$len = &$length_f();
main character energy fr fr.
β pset2hash
- Usage β
my $h = pset2hash([{name=>"id", value=>"56"}, {name=>"name", value=>"jim"}]); - Returns β hashref
- Args β arrayref of name/value keyed hashrefs
πΈ spell_greek
takes a word as a parameter and spells out any greek symbols encoded within it ποΈβ¨ (eg s/&agr;/alpha/g) β literal sorcery, we love to see it.
π₯ check_obj_graph
- Usage β (nothing listed, bestie)
- Returns β true if a cycle is detected π
- Args β any object
lowkey important: this is your cycle detector. if it comes back true, you've got a loop situation on your hands π
and that's the whole page!! ππ§ no cap, you're now fully caught up.
perl v5.36.0 Β· 2023-12-18 Β· mwah, go slay π ππ«Ά
π¦ where this page comes from
- debian trixie: libgo-perl 0.15-10 Β· Perl
- ubuntu noble: libgo-perl 0.15-10 Β· Perl
- ubuntu resolute: libgo-perl 0.15-10 Β· Perl
- ubuntu stonking: libgo-perl 0.15-10 Β· Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms