in reply to Re^2: help on reference to hash
in thread help on reference to hash

That's because it should be tcl_defs, not tclDefs:

my %my_tcldefs = %{$cliParms->{'tcl_defs'}};

EDIT: for the benefit of later readers and to avoid confusion, when I wrote this reply, the original question (since edited, apparently) indeed said tcl_defs.

Replies are listed 'Best First'.
Re^4: help on reference to hash
by skyworld_chen (Acolyte) on Jun 21, 2014 at 10:21 UTC

    Hi Dave,

    that is not the reason. Original design is tclDefs and I'm sure I matched the name in original reference. I guess there maybe other reasons, but I can't find it. thanks.

      In that case I'm not sure. The following works for me:

      #!/usr/bin/perl use feature qw(say); use Data::Dumper; $cliParms = { 'tcl_defs' => { my_var1 => 'a', my_var2 => 'b' } }; my %my_tcldefs = %{$cliParms->{'tcl_defs'}}; say Dumper(\%my_tcldefs);

      Could you post the code that's currently failing for you?

      P.S. I'm not Dave (davido).