![]() |
|
No such thing as a small change | |
PerlMonks |
text-file parsing with automatic field orderingby 0xbeef (Hermit) |
on May 31, 2007 at 10:51 UTC ( #618456=perlquestion: print w/replies, xml ) | Need Help?? |
0xbeef has asked for the wisdom of the Perl Monks concerning the following question:
Esteemed monks, I have somehow managed to produce the following code (derived in part from Using variable names from an array), which uses the first commented line of an input file to determine the order of the data records that follow. This means I do not have to make code changes when the file layout changes since I can simply adjust the commented header according the new data layout. i.e. a new file format of #category:surname:name will just automagically work...
which produces Is this type of referencing okay or insane, or is there mayber a simpler/better/faster way? (First prize = without using any external module) I do understand that the script lacks some error handling, but the question is more about the referencing... Niel
Back to
Seekers of Perl Wisdom
|
|