In your original program, you slurped the whole file into memory using

@DNA= <DNAFILE>
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
tie @DNA, 'Tie::File', "your_filename_goes_here", OPTIONS_GO_HERE or d +ie "Can not tie file ($!)";
In any case, have a look at the mode option.

-- 
Ronald Fischer <ynnor@mm.st>

In reply to Re: Seeking help for using Tie : : File in my perl program for counting bases using Active Perl 5.10.1 Build 1007 by rovf
in thread Seeking help for using Tie : : File in my perl program for counting bases using Active Perl 5.10.1 Build 1007 by supriyoch_2008

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.