in reply to Re: Re: What is a "stash"?
in thread What is a "stash"?

I don't recall saying it was efficient. It just makes sense as you pointed out:

the ease of using a hash instead of a module that will provide OO representation for you overrides the benefits of not using a hash so.... Yes, right?

How one arrives at such a conclusion is not really important.

I read that "all objects from an array" in one of O'Reilly's advanced perl books too. Having looked at the code required to maintain objects as arrays and the inability to play nicely with serialization tools like Data::Dumper was a real turn off.

Besides, I think the post below referencing the "stash" is probably more correct that anything thus far.

Replies are listed 'Best First'.
Re4: What is a "stash"?
by dragonchild (Archbishop) on Feb 06, 2003 at 15:01 UTC
    When I said ease, I should've said "ease of laziness" or "ease of not bothering". Personally, I hate using hashes as OO representations, at least directly. I don't want to think about how my object is represented in memory. Not using an OO-rep module forces me to do my own representation management. To me, that's very un-Perlish.

    I guess the sarcasm didn't come through in my first post. I apologize for any misunderstanding.

    Yes, the all-objects-in-array in the Panther book sucks with serialization. (The fix is actually relatively simple.)

    The other issue, however, is a straw man. You don't worry about the code required to maintain a CGI::Application or a DBI connection, do you? A well-tested CPAN module means you don't have to maintain the code. In fact, you don't know or care what code is required to do something, so long as it does it.

    ------
    We are the carpenters and bricklayers of the Information Age.

    Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.