Rex::G...::File(3pm)

πŸ’– Rex::Group::Lookup::File β€” the Perl man page, but make it bestie-coded πŸ’–

okay so this is Rex::Group::Lookup::File, from the User Contributed Perl Documentation collection, section 3pm. It's a Perl module. It's cute. It reads hostnames out of a file. That's the whole assignment and she ate. πŸŽ€


✨ NAME ✨

Rex::Group::Lookup::File β€” literally just read hostnames from a file. that's it. that's the job. no cap. πŸ¦‹


🌸 DESCRIPTION 🌸

Bestie. Listen. With this module you can define hostgroups out of a file. Like, you got a file with hostnames in it? boom, that's a hostgroup now. iconic behaviour honestly. πŸ‘‘


🫢 SYNOPSIS 🫢

the vibe check, in code form:

use Rex::Group::Lookup::File;
group "webserver" => lookup_file("./hosts.lst");

that's the whole thing. she's simple, she's elegant, she's main character energy. ✨


🌈 EXPORTED FUNCTIONS 🌈

πŸ’… lookup_file($file) πŸ’…

ok so with this function you can read hostnames from a file. and here's the part where i need you to lock in: every hostname goes on one line. one host, one line. that's the format. don't be weird about it. πŸ“

like so:

group "webserver"  => lookup_file("./webserver.lst");
group "mailserver" => lookup_file("./mailserver.lst");

look at that alignment. the spacing. the symmetry. not me being obsessed with two lines of Perl 😭✨

so yeah, that's the whole man page bestie. go forth and group your hosts. slay. πŸ’œ


okay bye, this was documented as part of Perl v5.40.1, dated 2025-10-03, and yes she's still serving after all this time. periodt. πŸ’–

πŸ“¦ where this page comes from