dereferencing hash from params

Posted by k0re on Stack Overflow See other posts from Stack Overflow or by k0re
Published on 2010-06-03T15:32:41Z Indexed on 2010/06/03 15:34 UTC
Read the original article Hit count: 253

Filed under:
|
|

Hi,

This code works:

  my $href = shift @_;    # get reference to hash
  my %h = %{$href};       # dereference hash

This one does not:

  my %h = %{shift @_};

As well as this one:

  my %h = ${$_[0]}

Why?

© Stack Overflow or respective owner

Related posts about perl

Related posts about hash