Mojo::Path - Path
use Mojo::Path; my $path = Mojo::Path->new('/foo/bar%3B/baz.html'); print "$path";
Mojo::Path is a container for URL paths.
Mojo::Path implements the following attributes.
leading_slash
my $leading_slash = $path->leading_slash; $path = $path->leading_slash(1);
parts
my $parts = $path->parts; $path = $path->parts(qw/foo bar baz/);
trailing_slash
my $trailing_slash = $path->trailing_slash; $path = $path->trailing_slash(1);
Mojo::Path inherits all methods from Mojo::Base and implements the following new ones.
new
my $path = Mojo::Path->new; my $path = Mojo::Path->new('/foo/bar%3B/baz.html');
append
$path = $path->append(qw/foo bar/);
canonicalize
$path = $path->canonicalize;
clone
my $clone = $path->clone;
parse
$path = $path->parse('/foo/bar%3B/baz.html');
to_string
my $string = $path->to_string;
Mojolicious, Mojolicious::Book, http://mojolicious.org.
To install Mojolicious, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojolicious
CPAN shell
perl -MCPAN -e shell install Mojolicious
For more information on module installation, please visit the detailed CPAN module installation guide.