in reply to Add array ref to another array ref
You are accessing the hashref as an arrayref, and then pushing data onto an array that now holds a ref to a hash %$data_b as the first item. You need to access the hashref in a slightly different way to a single element list arrayref.
Elements are acccessed from the inside out rather than the outside in. To 'push' on to hashes you may like to do something like this. Using the keyword each
use diagnostics -verbose; while( my ( $key, $value ) = each %$data_a ){ $data_b->{ $key } = $value } printf "%10s%12s\n", 'key:', ':value'; while( my ( $k, $v ) = each %$data_b ){ my $c; printf "%9s%-8s%-11s\n", $k, ++$c % 2 == 1 ? ' --- ' : '', $v; } __END__ key: :value house --- main first Mary number --- 0123 area north fullname --- Ms Mary Lou last Lou code --- zip
Also regarding Not A Hash error, try commenting out the push @{ $data_b }, ... line first. By accessing it as an array, you have wrapped it in an anonymous array. Which it now thinks it is.
# <- comment # push @{ $data_b }, $actually_im_not_parsed
|
|---|