Skip to content
Snippets Groups Projects
Commit afb8b916 authored by Andreas Kusalananda Kähäri's avatar Andreas Kusalananda Kähäri
Browse files

Use cwd() from the Cwd module instead of $ENV{PWD}.

Use -d instead of -e to test for directories.
parent d9241334
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,7 @@ package XrefMapper::db;
use vars '@ISA';
use Bio::EnsEMBL::DBSQL::DBConnection;
use Cwd;
sub new{
my($class, @args) = @_;
......@@ -101,17 +102,17 @@ sub process_dir {
my ($dir) = @_;
if($dir =~ "^\/" ) { # if it start with / then its not from pwd
if(! -e $dir){
if(! -d $dir){
die "directory does not exist $dir\n";
}
}
elsif($dir eq "."){
$dir = $ENV{PWD};
$dir = cwd();
}
elsif($dir =~ "^\.\/"){
my $tmp = $dir;
$dir = $ENV{PWD}."/".substr($tmp,2);
if(! -e $dir){
$dir = cwd() . "/" . substr( $tmp, 2 );
if(! -d $dir){
die "directory does not exist $dir\n";
}
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment