App::url - format a URL according to a sprintf-like template
$ url '%h' http://www.example.com/a/b/c www.example.com $ url '%H' http://www.example.com/a/b/c www $ url '%P' http://www.example.com/a/b/c /a/b/c
Decompose the URL and reformat it according to
%a - the path
%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
There are also some bonus formats unrelated to the URL:
%n - newline
%n
%t - tab
%t
%% - literal percent
%%
run( TEMPLATE, ARRAY )
Format each URL in ARRAY according to TEMPLATE and return an array reference
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.