Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

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' );

Replies are listed 'Best First'.
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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://900758]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2017-06-27 19:23 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (612 votes). Check out past polls.