perl - Getting the "base URL" of a URL -


In my application, I have to get the original URL of any URL. So far I like this:

  $ resp-> base;   

Where $ resp is an object, however, now I need to know the basis of the URL without actually requesting them and a Do you know one way to do this to get the HTTP :: response object?

You want to find the full url on which the ". " extension, You have relative to URL. may do. @ARGV '\' For http://www.example.org

  $ perl -MURI -E'say URI- & gt; New_abs (".", $ _) / Dir / '\' http://www.example.org/dir/file.html '\' http://www.example.org/dir/file.cgi?foo = Bar 'http: // www. Example.org/dir/ http://www.example.org/dir/ http://www.example.org/dir/    

Comments