Re: dereferencing



On Oct 29, 2007, at 5:21 PM, Tom Phoenix wrote:
I don't think that what the original poster
wants is even possible, but I can't see any reason to need it, either.

It's probably not necessary per se, as you can always do anything using reference syntax, but it's awkward and requires lots of extra dereferencing by the interpreter.

If %hash has a few thousand entries,

routine (%hash);

sub routine {
my %myhash = @_;
....
}

is wasteful and timeconsuming, and I don't want to have to type lots of extra arrows just because I passed the hash to a subroutine. And now I don't have to. Yay.

--
Aaron Priven, aaron@xxxxxxxxxx, http://www.priven.com/aaron


.



Relevant Pages

  • Re: Building HoHoH from arbitrary size arrays ?
    ... Basically I'm looking to create a sub routine which will query a ... column is a key in the hash of hashes. ... use warnings; ... I probably kludged up your beautiful code - please accept my humble apologies if this is the case. ...
    (comp.lang.perl.misc)
  • Merge two files
    ... key for a hash, a second sub routine to put the value from data file 1 into ...
    (perl.beginners)
  • Re: Breaking reference chians
    ... I've written a sub routine that reads the key value pairs and ... > then returns a reference to this hash. ... $localhash into $mainhash and pass $mainhash back. ...
    (comp.lang.perl.misc)
  • The array ARGV
    ... I have read that the array ARGV holds the command line arguments. ... I know in a sub routine @_ can be a hash. ...
    (comp.lang.perl.misc)
  • Re: Breaking reference chians
    ... > The config is then held in a hash of hashes. ... I've written a sub routine that reads the key ... > value pairs and then returns a reference to this hash. ...
    (comp.lang.perl.misc)