Hello Monks,
I've been searching for a solution to dump the contents of an entire hashref (HoH) - returned from a dbi fetchall_hashref into a scalar (not a $hashref).
Best attempt I could come up with is this:
my $param = join(q{, }, map{qq{$_ => $$ref2{$_}}} keys %$ref2);
but it's returning:
4 => HASH(0x5755668), 3 => HASH(0x55ddbb8), 2 => HASH(0x574e670), 9 =>
+ HASH(0x5767a18), 11 => HASH(0x5527fd8), 1 => HASH(0x574f230), 8 => H
+ASH(0x5639d48), 6 => HASH(0x574c6c8), 7 => HASH(0x54fae40), 12 => HAS
+H(0x5747fc8), 5 => HASH(0x562be30), 13 => HASH(0x57633d0), 10 => HASH
+(0x57648f8)
Or is it possible to use data::dumper to put contents into a scalar?
As always, thanks for helping me to figure this out!
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.