X
xuqy
I found a strange URI when I examined the crawling log of a web crawler
I recently wrote in Perl: "http://hamlug.org/../../../../". When I
paste it into web browser's address column, it was transformed to
"http://hamlug.org/", which is obviously correct. However, when I wrote
a simple test script as follows:
#!/usr/bin/perl -w
use strict;
my $rawURL = "http://hamlug.org/../../../../";
my $url = URI->new($rawURL)->canonical->as_string;
print $url, "\n";
To my great astonishment, URI::canonical method does nothing to my
$rawURL.
What is the reason?
Does there exist some module to tackle this?
I recently wrote in Perl: "http://hamlug.org/../../../../". When I
paste it into web browser's address column, it was transformed to
"http://hamlug.org/", which is obviously correct. However, when I wrote
a simple test script as follows:
#!/usr/bin/perl -w
use strict;
my $rawURL = "http://hamlug.org/../../../../";
my $url = URI->new($rawURL)->canonical->as_string;
print $url, "\n";
To my great astonishment, URI::canonical method does nothing to my
$rawURL.
What is the reason?
Does there exist some module to tackle this?