[nlug] Re: Perl Dereference Question

From: Paul Boniol (Yeah, right)
Date: 08/09/06

  • Next message: Bill Woody: "[nlug] Re: Postfix/IMAP/POP"

    mike wrote:
    > On 8/9/06, Timothy Ball <Yeah, right> wrote:
    >
    >> perldoc -f tie
    >>
    >> specifically I believe tie scalar is what magic you want.
    >
    >
    > *gah* tie magic is above and beyond simply "getting a variable %hash
    > that references the same data". tie magic requires a class that
    > implements the common functions of a hash. so while, yes, you COULD
    > tie a hash and have the implementation directly change the contents of
    > another hash, you must also consider the overhead, extra code, and
    > propensity for such an approach to needlessly complicate your code.
    >
    > it appears that paul is merely too damn lazy to type $hashref->{} and
    > wants to type $hash{} instead, presumably because his fingers don't
    > know how to work the infix dereference operator. $href-> has become
    > second nature to me. i very rarely use a flat hash.
    >
    > -mike

    Yes, tie is far more complicated than I was looking for. As Michael
    Chaney said, I was hoping there was something simple like
    %hash = %{ $hashref };
    but having them be the same instead of creating a copy as this does.

    I thought perhaps I was missing something obvious, but apparently not.

    Paul

    -- 
    Send all requests to:  Yeah, right
     Put your command in the SUBJECT of the message:
       "subscribe" or "unsubscribe"
    Quick unsubscribe: <mailto:Yeah, right?Subject=3Dunsubscribe>
    Mailing list archives may be found at: <http://www.nlug.org/mail/>
    **********************************************************************
    This list is from your pals at NetCentral <http://www.netcentral.com/>
    

  • Next message: Bill Woody: "[nlug] Re: Postfix/IMAP/POP"

    This archive was generated by hypermail 2.1.6 : 08/09/06 CDT