Mojo::URL man page on Fedora

Man page or keyword search:  
man Server   31170 pages
apropos Keyword Search (all sections)
Output format
Fedora logo
[printable version]

Mojo::URL(3)	      User Contributed Perl Documentation	  Mojo::URL(3)

NAME
       Mojo::URL - Uniform Resource Locator

SYNOPSIS
	 use Mojo::URL;

	 # Parse
	 my $url = Mojo::URL->new(
	   'http://sri:foobar@kraih.com:3000/foo/bar?foo=bar#23'
	 );
	 print $url->scheme;
	 print $url->userinfo;
	 print $url->host;
	 print $url->port;
	 print $url->path;
	 print $url->query;
	 print $url->fragment;

	 # Build
	 my $url = Mojo::URL->new;
	 $url->scheme('http');
	 $url->userinfo('sri:foobar');
	 $url->host('kraih.com');
	 $url->port(3000);
	 $url->path('/foo/bar');
	 $url->path('baz');
	 $url->query->param(foo => 'bar');
	 $url->fragment(23);
	 print "$url";

DESCRIPTION
       Mojo::URL implements a subset of RFC 3986 and RFC 3987 for Uniform
       Resource Locators with support for IDNA and IRIs.

ATTRIBUTES
       Mojo::URL implements the following attributes.

   "authority"
	 my $authority = $url->authority;
	 $url	       = $url->authority('root:pass%3Bw0rd@localhost:8080');

       Authority part of this URL.

   "base"
	 my $base = $url->base;
	 $url	  = $url->base(Mojo::URL->new);

       Base of this URL.

   "fragment"
	 my $fragment = $url->fragment;
	 $url	      = $url->fragment('foo');

       Fragment part of this URL.

   "host"
	 my $host = $url->host;
	 $url	  = $url->host('127.0.0.1');

       Host part of this URL.

   "port"
	 my $port = $url->port;
	 $url	  = $url->port(8080);

       Port part of this URL.

   "scheme"
	 my $scheme = $url->scheme;
	 $url	    = $url->scheme('http');

       Scheme part of this URL.

   "userinfo"
	 my $userinfo = $url->userinfo;
	 $url	      = $url->userinfo('root:pass%3Bw0rd');

       Userinfo part of this URL.

METHODS
       Mojo::URL inherits all methods from Mojo::Base and implements the
       following new ones.

   "new"
	 my $url = Mojo::URL->new;
	 my $url = Mojo::URL->new('http://127.0.0.1:3000/foo?f=b&baz=2#foo');

       Construct a new Mojo::URL object.

   "clone"
	 my $url2 = $url->clone;

       Clone this URL.

   "ihost"
	 my $ihost = $url->ihost;
	 $url	   = $url->ihost('xn--bcher-kva.ch');

       Host part of this URL in punycode format.

   "is_abs"
	 my $is_abs = $url->is_abs;

       Check if URL is absolute.

   "parse"
	 $url = $url->parse('http://127.0.0.1:3000/foo/bar?fo=o&baz=23#foo');

       Parse URL.

   "path"
	 my $path = $url->path;
	 $url	  = $url->path('/foo/bar');
	 $url	  = $url->path('foo/bar');
	 $url	  = $url->path(Mojo::Path->new);

       Path part of this URL, relative paths will be appended to the existing
       path, defaults to a Mojo::Path object.

   "query"
	 my $query = $url->query;
	 $url	   = $url->query(replace => 'with');
	 $url	   = $url->query([merge => 'with']);
	 $url	   = $url->query({append => 'to'});
	 $url	   = $url->query(Mojo::Parameters->new);

       Query part of this URL, defaults to a Mojo::Parameters object.

   "to_abs"
	 my $abs = $url->to_abs;
	 my $abs = $url->to_abs(Mojo::URL->new('http://kraih.com/foo'));

       Turn relative URL into an absolute one.

   "to_rel"
	 my $rel = $url->to_rel;
	 my $rel = $url->to_rel(Mojo::URL->new('http://kraih.com/foo'));

       Turn absolute URL into a relative one.

   "to_string"
	 my $string = $url->to_string;

       Turn URL into a string.

SEE ALSO
       Mojolicious, Mojolicious::Guides, <http://mojolicio.us>.

perl v5.14.1			  2011-09-11			  Mojo::URL(3)
[top]

List of man pages available for Fedora

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net