Object Orientation in Perl
My idea was inspired by compilers. They usually build a parse tree where the nodes store the matched text, logical information (what kind of token is this?) and the position in the source file.
Now if that parse tree is converted to an abstrac syntax tree, they still keep that line information, so if there is an execution error (let's say division by zero) the compiler can tell you which line of code caused that error.
So you can create a class "Traceable" that stores a string and its position in an input file to keep track of where it comes from.
It might be a bit overkill in your project, but for larger projects (parser, compiler) that is common practice.
(BTW it's nice to see that the quality of your questions improve over time ;)
In reply to Re^3: Tracking down errors in data from input files.