Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Relative URI

by Khen1950fx (Canon)
on Apr 22, 2011 at 03:47 UTC ( [id://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 (Patriarch) 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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://900758]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-03-29 00:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found