We don't bite newbies here... much | |
PerlMonks |
Re^2: How to walk through convoluted data?by perl-diddler (Chaplain) |
on Jul 22, 2021 at 11:21 UTC ( [id://11135288]=note: print w/replies, xml ) | Need Help?? |
Not to dispute anything you are suggesting, but more to explain how I got there. Before
mkBless (something I came up with on the fly while writing there -- not always my
best work -- BREAK--- Just as an FYI why I seem to go away for a while in middle of
conversations. My typing speed has decayed something fierce over the years...like down to 20-30% of faster times. No way can my typing keep up with my thoughts these days so sometimes blocks of explanatory text are skipped -- confusing readers and myself. But sigh.... In case someone
doesn't know, use mem allows me to mostly easily include a bunch of packages in 1 files.
And then a bunch of these progresssive assignments checking to see if each section is blessed. This started getting very repetitive and ugly looking.
This is where I saw I had: lvalue = new addon unless blessed lvalue; That's where mkBless came in -- to check if the levalue was blessed, and if so, assign more of the data-to-follow onto it. I had it return a value so I could skip some repetition at the beginning of each line. So, call that a class factory if you want, I'm not sure it is, but at least wanted you to see how it "fell out of" progressively adding on more data to walk through this DB. (is there anyway to insert a picture or diagram in this chaos? as it might help me clarify where I'm going....the old pic is worth a thousand words thing. Thanks for the feedback so far, I won't be annoyed if anyone dropps out of this mess, I sorta wish I could, but it stuff I need to get done to manage my system, UG. cheers!...oh and the bit about doing that "blessed test or return less work" bit, I probably would have gotten there eventually, in some later cleanup -- I put focus first on getting something to work -- and yes, I am one of those who keeps working at things to clean them up and make them better. -- because if I know I need to do that for my "future self" (if no one else) to able to reuse the code I write today.
In Section
Seekers of Perl Wisdom
|
|