Hi,

How can I modify the early part of code below
such that I don't have to manually key in the files this way:

perl mycode.pl data1P.fa data1R.fa data2P.fa data2R.fa ....etc

I.e. just by typing this will do:

perl mycode.pl


Thanks so much for your time beforehand.

--
Edward WIJAYA
Singapore

__BEGIN__
#!/usr/bin/perl
use strict;
use warnings;

for (@ARGV) {
    next if /P\./; # ignore the P files
    my ($base, $ext)= split /R/; #assume only one 'R' in the file name
    r_p_process ( $base."R".$ext, $base."P".$ext )
}

sub r_p_process {
    my $r_file=shift;
    my $p_file=shift;
    print "processing the pair $r_file $p_file\n";

    #then process two files
}
__END__



NOTE:
The code above take pair-series of files as follows:

   data1R.fa - data1P.fa
   data2R.fa - data2P.fa

From list of files in directory

data1R.fa
data2P.fa
data2R.fa
data2P.fa
....      #and there are more than 40 of these type files


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to