X-Git-Url: https://git.p6c8.net/devedit.git/blobdiff_plain/46c2cd86104b2699dd6af00c99b515c261e86337..977a71a3c15adbdd99d7fd5dbbbd384891e48335:/modules/Tool.pm?ds=sidebyside diff --git a/modules/Tool.pm b/modules/Tool.pm index fc1b3b4..1009640 100644 --- a/modules/Tool.pm +++ b/modules/Tool.pm @@ -6,7 +6,7 @@ package Tool; # Some shared sub routines # # Author: Patrick Canterino -# Last modified: 2003-12-02 +# Last modified: 2004-02-24 # use strict; @@ -24,6 +24,7 @@ use base qw(Exporter); @EXPORT = qw(check_path clean_path devedit_reload + equal_url file_name upper_path); @@ -125,9 +126,30 @@ sub devedit_reload($) return \$header; } +# equal_url() +# +# Create URL equal to a file or directory +# +# Params: 1. HTTP root +# 2. Relative path +# +# Return: Formatted link (String) + +sub equal_url($$) +{ + my ($root,$path) = @_; + my $url; + + $root =~ s!/$!!; + $path =~ s!^/!!; + $url = $root."/".$path; + + return $url; +} + # file_name() # -# Returns the last path of a path +# Return the last path of a path # # Params: Path # @@ -149,7 +171,7 @@ sub file_name($) # upper_path() # -# Cut the last part of a path away +# Cut away the last part of a path # # Params: Path #