in reply to When to use Tie

It's funny you bring this up. Looking through my older nodes, I came across something I wrote,Validate Country by ISO 3166 data. This is a tie class that lets you validate country codes. I was wondering for the life of me, why I wrote it as a tie. I think there was a reason at the time, but I was thinking as I looked at it,it was more suited for a function.

On the other hand, I totally disagree about your comment that they belong under Acme:: namespace. If you don't want to use them, don't, but for someone else, this make perfect sense.


-Lee

"To be civilized is to deny one's nature."

Replies are listed 'Best First'.
Re: Re: When to use Tie
by hardburn (Abbot) on Jan 29, 2004 at 18:00 UTC

    I don't view the Acme:: namespace as a "never use this in a real program" place. Rather, it's more of a "isn't this cute?" place. Making a tied hash that does Google searches (like Tie::Google) strikes me as something cute, but doesn't offer more functionality than Net::Google (which Tie::Google is based on).

    There are a few odd Acme:: modules that are both cute and useful in production code. I could imagine a few good uses of Acme::SoftwareUpdate. Acme::Morse::Audible might be useful in a Morse code trainer program.

    ----
    I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
    -- Schemer

    : () { :|:& };:

    Note: All code is untested, unless otherwise stated

      I agree with the assessment on Tie::Google, but my feeling is that if people want to do it, and people want to use it, that's fine with me. To someone else, this may be an intuitive way to address a problem.

      To me, Acme exists for interesting things of no practical value. I'd be hesitant to use Acme:: modules in anything production, solely on the name (Easy enough to cut and past into a new module though)

      -Lee

      "To be civilized is to deny one's nature."