in reply to Re: When will "Using a hash as a reference is deprecated" be enforced?
in thread When will "Using a hash as a reference is deprecated" be enforced?

I didn't know about this either, but I just looked it up and it appears you can use a hash just like a hash-ref and it will work (but give that warning):
perl -Mwarnings -Mstrict -e'my %a = ( a => 1); print %a->{a}' Using a hash as a reference is deprecated at -e line 1. 1
  • Comment on Re^2: When will "Using a hash as a reference is deprecated" be enforced?
  • Download Code

Replies are listed 'Best First'.
Re^3: When will "Using a hash as a reference is deprecated" be enforced?
by shmem (Chancellor) on Mar 22, 2007 at 23:42 UTC
    Wow. I wonder how much thought and discussion went into this dwimmery now deprecated? What more of the like is in perl that I don't know?

    I'm unable to interprete the shudders runinng down my back after knowing this right now. Pleasure? Fright? Have to work that out...

    --shmem

    _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                  /\_¯/(q    /
    ----------------------------  \__(m.====·.(_("always off the crowd"))."·
    ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
      What more of the like is in perl that I don't know?
      got me thinking, so i tried it with an array. wacky!
      % perl -Mwarnings -Mstrict -e 'my @a = (1); print @a->[0]'
      Using an array as a reference is deprecated at -e line 1.
      1