Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Relative URI

by Khen1950fx (Canon)
on Apr 22, 2011 at 03:47 UTC ( #900758=note: print w/ replies, xml ) Need Help??


in reply to Relative URI

Using Test::URI, ../../../y seems relatively correct:

#!/usr/bin/perl use strict; use warnings; use URI; my $uri_string1 = 'http://a.b.c/d/../e/'; my $uri_string2 = 'http://a.b.c/y'; my $base = URI->new($uri_string1); my $uri = URI->new($uri_string2); print $base->abs($uri), "\n"; print $uri->abs($base), "\n"; print $base->rel($uri), "\n"; print $uri->rel($base), "\n"; print "\n"; use Test::URI; use Test::More tests => 4; use_ok( 'Test::URI' ); uri_scheme_ok( $uri_string2, 'http' ); uri_host_ok( $uri_string2, 'a.b.c' ); uri_path_ok( $uri_string2, '/y' );


Comment on Re: Relative URI
Select or Download Code
Re^2: Relative URI
by ikegami (Pope) on Apr 22, 2011 at 06:28 UTC
    What do you think you're testing? Your code in no way supports your conclusion.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://900758]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (11)
As of 2014-08-21 13:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (135 votes), past polls