Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re^5: hash and array

by ihb (Deacon)
on May 23, 2005 at 00:02 UTC ( [id://459406] : note . print w/replies, xml ) Need Help??

in reply to Re^4: hash and array
in thread hash and array

%hash{$_}++ for @array

I'd expect it to be more like map instead of for, so that you can do

@old = %hash{@keys} >>++;
but I'm 100% guessing.


See perltoc if you don't know which perldoc to read!

Replies are listed 'Best First'.
Re^6: hash and array
by mrborisguy (Hermit) on May 23, 2005 at 00:12 UTC

    You know what, I can't even say. I was going to try it out, see what it did, but I can't even get:

    %hash{ @keys } >>++;

    to run, much less

    @old = %hash{ @keys } >>++;

    So I don't know what the deal is. I'm running Pugs, and I updated it from svn just today, so maybe they just haven't implimented it yet. I'm pretty sure I was there when japhy asked the question on #perl6, so I'm fairly confident the syntax must be right. What I'm trying to say, I guess, is that I just don't know enough to answer your question! (Man, I hate when that happens!)