In your original program, you slurped the whole file into memory using
and then used the array @DNA for processing the data. Of course it would be better to write your program in a way that it reads only one line at a time, but if the logic of your application already assumes that you have the data in an array, and your program is already working well, trying Tie::File doesn't cost much, because you don't have to change a lot. Instead of opening and reading the file, you would use@DNA= <DNAFILE>
In any case, have a look at the mode option.tie @DNA, 'Tie::File', "your_filename_goes_here", OPTIONS_GO_HERE or d +ie "Can not tie file ($!)";
--
Ronald Fischer <ynnor@mm.st>
Ronald Fischer <ynnor@mm.st>
|
---|
In Section
Seekers of Perl Wisdom