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

Re: Minimizing paths?

by sharkey (Scribe)
on Sep 17, 2002 at 18:54 UTC ( [id://198590]=note: print w/replies, xml ) Need Help??


in reply to Minimizing paths?

I did something similar for creating absolute paths for use in redirects. Here's the code:
sub absolute_url ($$) { my ($base,$url) = @_; $base =~ s{/[^/]*$}{/}; # remove file from base $url = $base.$url; # append base and url 1 while ( $url =~ s{/[^/]*/\.\./}{/} ); # remove .. return $url; # all done! }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2024-04-23 08:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found