in reply to Re: Not a HASH reference using YAML
in thread Not a HASH reference using YAML

How would you do it if it is an array reference? Thanks!

Replies are listed 'Best First'.
Re^3: Not a HASH reference using YAML
by tobyink (Canon) on Aug 17, 2012 at 15:10 UTC

    Array refs use square brackets rather than curly braces; and numeric indices rather than strings. So something like ->[0].

    Of course, I haven't seen your data, so it's impossible for me to say at what point you need to do this.

    perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'