installing scripts (was:Re: [Bioperl-l] GFF scripts)

Koen van der Drift kvddrift at earthlink.net
Sun Aug 10 17:33:05 EDT 2003



> My knowledge of perl is limited, so I am not sure how to proceed from 
> here. Is there a MakeFile.PL that installs the scripts and works with 
> 1.2.2? Or maybe I forgot to copy some essential lines from the newer 
> Makefile.PL?

OK, I am a little bit further :) I solved the rmtree problem by adding 
the following lines:

use File::Path 'rmtree';
use IO::File;
use Config;

I did the other two 'just in case'. Now scripts get installed, but only 
a few: bp_flanks.pl, bp_mrtrans.pl, bp_sreformat.pl and 
bp_taxi4dspecies.pl.

Careful examination of the code reveals that only the scripts that have 
an .PLS extension will be installed, which are exactly the 4 scripts 
that get installed. All other scripts already have the .pl extension, 
and thus will not be installed. So I modified the script as follows:

sub install_contents {
   my $dir  = shift;
   my $dest = shift;
   my $bangline = $Config{startperl};

   my @files;
   opendir (D,$dir) or die "Can't open $dir: $!\n";
   while (my $script = readdir(D)) {
  #   next unless $script =~ /\.PLS$/;
     my $in  = IO::File->new("$dir/$script")    or die "Can't open 
$dir/$script: $!";

	if ($script =~ /\.PLS$/) {
     	$script =~ s/\.PLS$/\.pl/;                   # change from .PLS to 
.pl
	}
     next unless $script =~ /\.pl$/;

   ... etc

Which indeed seems to do the trick.

Would this change give any other problems that I might overlook?


thanks again,

- Koen.



More information about the Bioperl-l mailing list