url - format a URL according to a sprintf-like template
# format as just the host $ url '%H' http://www.example.com/a/b/c www.example.com # handle more than one. $ url '%H' http://www.example.com/a/b/c http://www.github.com www.example.com www.github.com # get the path $ url '%P' http://www.example.com/a/b/c /a/b/c
Decompose the URL and reformat it according to a template.
%a - the path
%a
%A - the addresses
%A
%f - the fragment
%f
%h - the hostname, with domain info
%h
%H - the hostname without domain info
%H
%i - the hostname in punycode
%i
%I - space-separated list of IP addresses for the host
%I
%P - the password of the userinfo portion
%P
%p - the port
%p
%q - the query string
%q
%s - the scheme
%s
%S - the public suffix
%S
%u - the complete URL
%u
%U - the username of the userinfo portion
%U
Copyright © 2020-2024, brian d foy, all rights reserved.
You can use this code under the terms of the Artistic License 2.
To install App::url, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::url
CPAN shell
perl -MCPAN -e shell install App::url
For more information on module installation, please visit the detailed CPAN module installation guide.