Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: Add array ref to another array ref

by Anonymous Monk
on Jul 15, 2019 at 19:21 UTC ( [id://11102886]=note: print w/replies, xml ) Need Help??


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:  <%-{-{-{-<

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11102886]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2024-04-23 20:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found