1Mojo::Path(3) User Contributed Perl Documentation Mojo::Path(3)
2
3
4
6 Mojo::Path - Path
7
9 use Mojo::Path;
10
11 my $path = Mojo::Path->new('/foo/bar%3B/baz.html');
12 print "$path";
13
15 Mojo::Path is a container for URL paths.
16
18 Mojo::Path implements the following attributes.
19
20 "leading_slash"
21 my $leading_slash = $path->leading_slash;
22 $path = $path->leading_slash(1);
23
24 Path has a leading slash.
25
26 "parts"
27 my $parts = $path->parts;
28 $path = $path->parts(qw/foo bar baz/);
29
30 The path parts.
31
32 "trailing_slash"
33 my $trailing_slash = $path->trailing_slash;
34 $path = $path->trailing_slash(1);
35
36 Path has a trailing slash.
37
39 Mojo::Path inherits all methods from Mojo::Base and implements the
40 following new ones.
41
42 "new"
43 my $path = Mojo::Path->new;
44 my $path = Mojo::Path->new('/foo/bar%3B/baz.html');
45
46 Construct a new Mojo::Path object.
47
48 "append"
49 $path = $path->append(qw/foo bar/);
50
51 Append parts to path.
52
53 "canonicalize"
54 $path = $path->canonicalize;
55
56 Canonicalize path.
57
58 "clone"
59 my $clone = $path->clone;
60
61 Clone path.
62
63 "parse"
64 $path = $path->parse('/foo/bar%3B/baz.html');
65
66 Parse path.
67
68 "to_string"
69 my $string = $path->to_string;
70
71 Turn path into a string.
72
74 Mojolicious, Mojolicious::Guides, <http://mojolicious.org>.
75
76
77
78perl v5.12.3 2011-05-03 Mojo::Path(3)