Mojo::Home(3)
π Mojo::Home π
okay so bestie, welcome to Mojo::Home β from the Perl user docs, and honestly? home sweet home π‘β¨ That's literally the tagline, I'm not even kidding.
β¨ SYNOPSIS β¨
like, here's the whole vibe:
use Mojo::Home;
# Find and manage the project root directory
my $home = Mojo::Home->new;
$home->detect;
say $home->child('templates', 'layouts', 'default.html.ep');
say "$home";
no cap, that's it. that's the whole entrance exam π
πΈ DESCRIPTION πΈ
Mojo::Home is a container for home directories, and it's built on top of Mojo::File β so like, it's got the whole family tree backing it up π«Ά
π METHODS π
okay so the way this works: Mojo::Home inherits all methods from Mojo::File (all of them, she's a nepo baby and we love her for it π
) and then implements these new ones:
π¦ detect
$home = $home->detect;
$home = $home->detect('My::App');
this is the main character method fr fr β it detects the home directory from the value of the MOJO_HOME environment variable, or from the location of the application class. iykyk π
π rel_file
my $path = $home->rel_file('foo/bar.html');
returns a new Mojo::Home object that's relative to the home directory. slay, she ate π
β OPERATORS β
Mojo::Home inherits all overloaded operators from Mojo::File. periodt, nothing new to learn here π
π SEE ALSO π
MojoliciousMojolicious::Guides- <https://mojolicious.org>
go read 'em, they're iconic π
k bye bestie!! π§ this was Mojo::Home(3) from perl v5.42.0, dated 2026-07-15 β mwah, see you in the next manpage πππ₯
π¦ where this page comes from
- opensuse-leap 16.0: perl-Mojolicious 9.480.0-bp160.2.1 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms