As you do not ask for something nor point to particular errors i can only guess:
first i cannot understand how your data sample can be splitted using \t\s pattern (ah ok you are setting $/ for this..).
second i do not see where you are opening files (maybe the script is run under -nl ?)
If each file just contains 2 lines you can simply do:
my $key = <$filehandle>; # first line my $value = <$filehandle>; # second line
You also have no need to iterate over an array to get the count: @array in scalar context returns the numbers of elements. Also $#array contains the index of the last element ( so $#array + 1 == scalar @array ).
You also want the name of the file to be preserved somehow: you can read about $ARGV or you must create a sub that given the filename as arg, open it process it and store the filename along results.
A pray to you and to ALL BIONFORMATICS here around: sample data can be AGATC instead of a line of hundreds of chars? have readable data as sample help my eyes a lot!
L*
In reply to Re: count total number of occurrence in all files
by Discipulus
in thread Reaped: count total number of occurrence in all files
by NodeReaper
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |