Tools for modeling links between files / URLs / etc.
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.

testuri.pl 624B

123456789101112131415161718192021222324252627282930
  1. #!/usr/bin/env perl
  2. use warnings;
  3. use strict;
  4. use 5.10.0;
  5. use URI;
  6. my @samples = (
  7. 'http://www.perl.com',
  8. 'http://www.perl.com/#somebullshit',
  9. 'file:///home/brennen/p1k3',
  10. 'urn:vimwiki:p1k3',
  11. 'mailto:pieces@chaff.p1k3.com',
  12. 'pieces@chaff.p1k3.com',
  13. );
  14. foreach my $sample (@samples) {
  15. my $u = URI->new($sample);
  16. say "";
  17. say $sample . " :::::: ";
  18. say "scheme\t" . $u->scheme;
  19. # say "authority\t" . $u->authority;
  20. say "opaque\t" . $u->opaque;
  21. say "path:\t" . $u->path;
  22. say "fragment:\t" . $u->fragment;
  23. say "recognized?\t" . $u->has_recognized_scheme;
  24. say "canonical:\t" . $u->canonical;
  25. }