Inheritance is a fundamental OO technique; see Section 3.14 for Perl OO reference material that includes discussion of inheritance.
For programming with sequence data file formats, see the C program readseq by Don Gilbert (at http://iobio.bio.indiana.edu/soft/molbio/readseq).
See the Bioperl project at http://www.bioperl.org for alternate ways to handle this programming task in Perl.
For a more rigorous but slower approach to parsing sequence files (which is sometimes what you want) see the module Parse::RecDescent by Damien Conway at CPAN.
Each sequence file format has documentation that describes it. These formats sometimes change to keep up with the changing nature of biological data. One of the following exercises challenges you to find the documentation for one of the formats and to improve the code in this chapter for that format.