Why is it that in perl 5 I can do:

use English::Dereference; #Or equivalent, relevant section included below
sub ARRAY {
    return @{ shift() };
}
sub HASH {
    return %{ shift() };
}

print join(' ', ARRAY [1,2,3,4]), "\n";

And the seemingly parallel:

print join(' ', HASH {1,2,3,4}), "\n";

works as well, but you wish to do say:

print join(' ', keys HASH {1,2,3,4}), "\n";

It fails miserably with:

Type of arg 1 to keys must be hash (not scalar ref constructor) at - line 1,
near "})"

So basically, it would be nice if each, keys, values, etc. could all deal
with being handed a hash from a code block or subroutine...
-- 
                                                  *             __    *      .
           \     |     /           .        . .           .  . ((_
               _____                       .                         .     .
          --  /     \  --           .        .      .   +    .   .     _/\
      oooooooooo.   |               * .       .   .           *       / ;M\_ .
   .oooooooooooo.oo.                  .  .    .       . /\    .      /  :IMM\
  ..oooooooooooo..oo.   Jerrad Pierce              /\  /  \         /   ;IIWMM
  ..oooooooooo.......   209 North Street     +    /  \ /  \  .     /   ;IIIIWM
  ...ooooooooo.......   Randolph, MA 02368        /  \     \  ___/   :;IIIIIWM
  ....ooo....o.......                            /    \    \ /  ::     ;;IIIMI
   .....ooo.........    http://www.pthbb.org     /    \     \   :     :::;IIIM
     ..ooooooo....      __________________________ ||   ||       ::.....::::::
MOTD on Pungenday, the 14th of Bureaucracy, in the YOLD 3166:

``How did it get so late so soon? It's night before it's afternoon. December is here 
before it's June. My goodness how the time has flewn. How did it get so late so 
soon?'' -Dr. Seuss

Reply via email to