Just another Perl shrine | |
PerlMonks |
Re^2: Object accessors with unknown databy Amblikai (Scribe) |
on Jan 26, 2015 at 13:00 UTC ( [id://1114517]=note: print w/replies, xml ) | Need Help?? |
So it's potentially not a great candidate for OOP? Basically, i'm writing a Spreadsheet to Template program. I've already done it without OOP, but i thought it'd be good to have each line of the spreadsheet as an object. In other words, I take a config file with a list of the column headings/titles. The program reads the sheet and finds the title row. Each line of the spreadsheet then becomes a hash where the key is the title, and the value is the spreadsheet value. It's then really easy to build templates from the spreadsheet. I use it a lot. I figured i'd have each line of the spreadsheet as an object and then i could have lot's of little methods i could directly call from the template to modify the data. (Split lists etc). The problem being i don't know what the title would be so i don't know how i'd access each attribute. The template would know as it would be written by the user in reference to the spreadsheet/config file. Bad idea to use OOP? Thanks for all your replies
In Section
Seekers of Perl Wisdom
|
|