Rex::Hardware(3pm)

✨ NAME ✨

Rex::Hardware β€” the glow-up base class for all your hardware / information gathering needs πŸ’… it's giving "I ask the machine questions and the machine answers" energy, fr fr.


🌸 DESCRIPTION 🌸

okay so bestie, lowkey this is the base class for hardware/information gathering. that's it, that's the vibe β€” everything else in the hardware-gathering family descends from this queen πŸ‘‘. she doesn't do the gathering herself, she's the blueprint. main character energy only.


πŸ¦‹ SYNOPSIS πŸ¦‹

use Rex::Hardware;

my %host_info = Rex::Hardware->get(qw/ Host /);
my %all_info  = Rex::Hardware->get(qw/ All /);

see how easy?? <italic>use</italic> it, then call <italic>get</italic> and boom πŸ’₯ β€” a hash of info is yours. that's the whole plot.


πŸŽ€ CLASS METHODS πŸŽ€

πŸ’– get(@modules)

Returns a hash with the wanted information. literally just tell it which modules you want and it hands you the goods, no cap πŸ’…

task "get-info", "server1", sub {
  %hw_info = Rex::Hardware->get(qw/ Host Network /);
};

asking for exactly <italic>Host</italic> and <italic>Network</italic>?? iconic, selective, we love a girl who knows what she wants ✨

Or if you want to get all information:

task "get-all-info", "server1", sub {
  %hw_info = Rex::Hardware->get(qw/ All /);
};

the <italic>All</italic> glutton route πŸ“ β€” she said "give me everything", and honestly? valid.

🌈 Available modules:

  • Host
  • Kernel
  • Memory
  • Network
  • Swap
  • VirtInfo

six little modules, six little slays, pick your faves and go 🫢


and that's the whole page bestie, no notes πŸ’œ this gem came to you courtesy of perl v5.40.1, dated 2025-10-03, part of the User Contributed Perl Documentation collection β€” go gather you some hardware info, you absolute icon πŸŽ€βœ¨

πŸ“¦ where this page comes from