Hi,
I am a newbie to Perl and I am trying to bring several files into their own
separate arrays for processing in a single script.
Currently I am able to read in the files, but they all dump into a single
array.  I need to create a new array for each file, but I am not sure how
this is done.
Is there an easy way to increment the array for each file?

Thank You.




$N = 20; 

@ARGV = ("1.fsa", "2.fsa", "3.fsa");


foreach $fname ( @ARGV )
 {
   local $seq;
   open (FD,"<$fname") || die "cannot open $fname!\n";
   $hash = $hash+$fname;
   while ( <FD> )     {
    
       chop;    # drop newline at end of line
       $seq .= $_ if $_ !~/\>/;    # ignore header
       
       }
       
       for ($i=0; $i+$N < length($seq); $i++) {
           $n++;
           $ngram = substr($seq,$i,$N);
           $hash{$ngram}++;
           print $hash{$ngram};
       
     
   
 }  
   
   $name[$namcnt++] = $fname;

   close ( FD );   
 }


E W Dahlstrom                  [EMAIL PROTECTED]
Novato Ca



Reply via email to