Dotfiles, utilities, and other apparatus.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

33 lines
666 B

#!/usr/bin/env perl
use warnings;
use strict;
use 5.10.0;
use URI;
my @samples = (
'http://www.perl.com',
'http://www.perl.com/#somebullshit',
'file:///home/brennen/p1k3',
'urn:vimwiki:p1k3',
'mailto:example@example.com',
'example@example.com',
);
foreach my $sample (@samples) {
my $u = URI->new($sample);
say "";
say $sample . " :::::: ";
say "scheme\t" . $u->scheme;
# this'll explode if there's no authority
# say "authority\t" . $u->authority;
say "opaque\t" . $u->opaque;
say "path:\t" . $u->path;
say "fragment:\t" . $u->fragment;
say "recognized?\t" . $u->has_recognized_scheme;
say "canonical:\t" . $u->canonical;
}