1Mojo::Home(3) User Contributed Perl Documentation Mojo::Home(3)
2
3
4
6 Mojo::Home - Home sweet home
7
9 use Mojo::Home;
10
11 # Find and manage the project root directory
12 my $home = Mojo::Home->new;
13 $home->detect;
14 say $home->child('templates', 'layouts', 'default.html.ep');
15 say "$home";
16
18 Mojo::Home is a container for home directories based on Mojo::File.
19
21 Mojo::Home inherits all methods from Mojo::File and implements the
22 following new ones.
23
24 detect
25 $home = $home->detect;
26 $home = $home->detect('My::App');
27
28 Detect home directory from the value of the "MOJO_HOME" environment
29 variable or the location of the application class.
30
31 rel_file
32 my $path = $home->rel_file('foo/bar.html');
33
34 Return a new Mojo::Home object relative to the home directory.
35
37 Mojo::Home inherits all overloaded operators from Mojo::File.
38
40 Mojolicious, Mojolicious::Guides, <https://mojolicious.org>.
41
42
43
44perl v5.36.0 2023-01-20 Mojo::Home(3)