[Bioperl-l] error loading sequence

Sendu Bala bix at sendu.me.uk
Tue Jul 24 18:39:33 EDT 2007


Munirul Islam wrote:
> Hello everyone:
> 
> I am having problem loading a sequence file from within a directory.  
> 
> #############################################################
> $dirname = "rundir";
> opendir (DIR, $dirname) || die("can't open $dirname");
>       
> while (defined($file = readdir(DIR))) {
>     next if $file =~ /^\.\.?$/;		# skip . and ..
>     $abs_path = File::Spec->rel2abs( $file ) ;
>     
>     # gives a file not found exception for the following code

This isn't a Bioperl problem. You're using the wrong File::Spec method. 
You want File::Spec->catfile($dirname, $file).


More information about the Bioperl-l mailing list