in reply to Retrieving an anonymous hash

Following up on what TomDLux said, another way of not copying the hash is to use type globs.
#Turn OFF use strict local *tempHash = $arrayOfHashes[0] ; # Now you can access $tempHash{whatever}

Offense, like beauty, is in the eye of the beholder, and a fantasy.
By guaranteeing freedom of expression, the First Amendment also guarntees offense.

Replies are listed 'Best First'.
Re: Re: Retrieving an anonymous hash
by BUU (Prior) on Mar 18, 2004 at 23:22 UTC
    #Turn OFF use strict
    Manipulating typeglobs is perfectly legal under strict, it's trying to treat strings as typeglobs thats illegal.
      Actually you need to turn OFF strict when you USE the local variable, otherwise, you get
      Global symbol "$x" requires explicit package name at blah ...

      To minimize exposure, it should be coded thus:

      no strict qw(vars); ## Accessing code here ... use strict qw(vars);

      Offense, like beauty, is in the eye of the beholder, and a fantasy.
      By guaranteeing freedom of expression, the First Amendment also guarntees offense.