NAME
Skilletor::URL - The parts of a URL as the WHATWG URL parser (Node's new URL) gives them
VERSION
version 0.001
SYNOPSIS
use Skilletor::URL qw( parse_url );
my $u = parse_url('https://user@Example.COM:443/a/../b c?x#y');
# { protocol => 'https:', hostname => 'example.com', port => '',
# pathname => '/b%20c', search => '?x', hash => '#y', ... }
my $bad = parse_url('https://example.com:99999/'); # undef: new URL throws
DESCRIPTION
The reference reads a URL with new URL() where its answer reaches a name or a decision: the derived name of an add spec (hostname, pathname) and the scheme check of a url source. This is the WHATWG parser for absolute URLs, as far as those answers go: special and non-special schemes, userinfo, port (digits, at most 65535, the default dropped), host (percent-decoding, lower case, IDNA as NFC + lower case + punycode, IPv4 in every WHATWG form, IPv6 kept), path (dot segments, \ as a separator of special schemes, the path percent-encode set). It does not validate IPv6 or apply the full UTS #46 mapping table.
parse_url
my $parts = parse_url($input);
undef where new URL($input) throws; else { protocol, username, password, hostname, port, pathname, search, hash }.
punycode_encode
RFC 3492 punycode of one label.
SUPPORT
CONTRIBUTING
Contributions are welcome! Please fork the repository and submit a pull request.
AUTHOR
Torsten Raudssus <getty@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2026 by Torsten Raudssus <torsten@raudssus.de> https://raudssus.de/.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.