Hi there!
I am looping this array but I am getting "HASH(0x28c0af8)" as part of the results.
Any better way?
$VAR1 = {
'12349' => [
{
'name' => 'RIC',
'reference' => '00y77676',
}
],
'X334' => [
{
'name' => 'MES',
'reference' => '0089kkjh9',
}
],
'U7564' => [
{
'name' => 'CHAMV',
'reference' => '00gt6544',
}
],
'Q234' => [
{
'name' => 'INGTON',
'reference' => '0099ytr',
}
],
'K988777' => [
{
'name' => 'LOE',
'reference' => '9887hhh',
},
{
'name' => 'TYL',
'reference' => '00ttr54433',
},
{
'name' => 'TLYN',
'reference' => '099iuuy7',
},
{
'name' => 'LEEN',
'reference' => '0yy76767',
},
{
'name' => 'TSY',
'reference' => '00hyu65',
},
{
'name' => 'ASTCIA',
'reference' => '0dree4333',
},
{
'name' => 'IRNDA',
'reference' => '99877uuug',
}
],
'P99987' => [
{
'name' => 'JOSPH',
'reference' => '0gft5210',
}
],
};
process(\%thedata);
sub process {
my $all = shift;
my %run_all = %$all;
foreach my $key (keys %run_all){
print "$key\n";
foreach my $entry (@{$run_all{$key}}) {
print "$entry\n";
}
print "\n";
}
}
Thank you!
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.