in reply to Re: Add array ref to another array ref
in thread Add array ref to another array ref

I am getting confused with the data types.
I did a data dumper on $data_b and got this:
$VAR1 = [ { 'house' => 'main', 'number' => '0123', 'area' => 'north', 'code' => 'zip', }; ]

And on $data_a was this:
$VAR1 = { 'fullname' => 'Ms Mary Lou', 'first' => 'Mary', 'last' => 'Lou', };

Replies are listed 'Best First'.
Re^3: Add array ref to another array ref
by talexb (Chancellor) on Jul 15, 2019 at 19:41 UTC

    When you see the square brackets [], that's an arrayref (a reference to an array). When you see braces {}, that's a hashref (a reference to a hash).

    So the first VAR1 that you see is an arrayref with a single element, which is a hashref. The second VAR1 is just a hashref.

    Alex / talexb / Toronto

    Thanks PJ. We owe you so much. Groklaw -- RIP -- 2003 to 2013.

Re^3: Add array ref to another array ref
by AnomalousMonk (Archbishop) on Jul 15, 2019 at 19:32 UTC

    Please see this, especially the Update.


    Give a man a fish:  <%-{-{-{-<