--- foxridge-archiver/MPIWGStor.pm 2005/05/26 14:31:28 1.3 +++ foxridge-archiver/MPIWGStor.pm 2006/02/10 17:01:18 1.6 @@ -12,7 +12,7 @@ use vars qw(@ISA @EXPORT $VERSION $file_perm); use Exporter; -$VERSION = 0.6; # ROC 26.5.2005 +$VERSION = 0.6.2; # ROC 10.2.2006 @ISA = qw(Exporter); @@ -140,12 +140,17 @@ sub ymd_date { # file name (the last path element) and path # sub split_file_path { - my ($fn) = @_; + my ($fn, $nodot) = @_; if ($fn =~ /^(.*)\/([^\/]+)$/) { return ($2, $1); + } + # only file name + if ($nodot) { + return ($fn, ''); + } else { + return ($fn, '.'); } - return $fn; } @@ -157,7 +162,7 @@ sub split_file_path { sub sstrip { my ($name) = @_; - if ($name =~ /\s*(.*)\s*/) { + if ($name =~ /^\s*(.*?)\s*$/) { return $1; } return $name;