From 258ec0b29f3b69680b6de4ddc9704c3710a50178 Mon Sep 17 00:00:00 2001 From: pcanterino <> Date: Mon, 13 Oct 2003 17:35:48 +0000 Subject: [PATCH] check_path() was cleaned up. It now uses upper_path() and file_name() instead of fileparse(). --- modules/Tool.pm | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/modules/Tool.pm b/modules/Tool.pm index a37967e..9e89e43 100644 --- a/modules/Tool.pm +++ b/modules/Tool.pm @@ -6,7 +6,7 @@ package Tool; # Some shared sub routines # # Author: Patrick Canterino -# Last modified: 10-03-2003 +# Last modified: 2003-10-03 # use strict; @@ -14,7 +14,6 @@ use strict; use vars qw(@EXPORT); use Cwd qw(abs_path); -use File::Basename; use File::Spec; ### Export ### @@ -54,17 +53,11 @@ sub check_path($$) # The path points to a file # We have to extract the directory name and create the absolute path - my @pathinfo = fileparse($path); + my $dir = upper_path($path); + my $file = file_name($path); - # This is only to avoid errors - - my $basename = $pathinfo[0] || ''; - my $dir = $pathinfo[1] || ''; - my $ext = $pathinfo[2] || ''; - - $dir = abs_path($dir); - - $path = $dir."/".$basename.$ext; + $dir = abs_path($dir); + $path = $dir."/".$file; } else { -- 2.34.1