slothrop has asked for the wisdom of the Perl Monks concerning the following question:
I am currently writing a script to report on problematic entries in our company project management software's address list. I want to emit a a report in plain text, using Perl6::Form if possible. So far, it is mostly working, except for reporting entries with duplicate email addresses. While traversing the database, I gather duplicate email addresses in to a hash of lists, where the keys are the email adresses and the respective lists contain the names of the people who have that address listed.
I would like the output to look something like this:+------------------------------------------------------------+ | fake_address1@example.com John Doe | | Jane Doe | | | | fake_address2@example.com John Doe | | Jane Doe | ...Currently, I am calling form like this:
my %table = get_duplicates(); # More complicated, but you get the idea +. my @addresses = sort keys %table; my $report = form {bullet => '*'}, '+-----------------------------------------------------------+', '| {[[[[[[[[[[[[[[[[[[[[[[[[[[[} * {[[[[[[[[[[[[[[[[[[[[[} |', \@addresses, [map { $table{$_} @adresses], '| |', '+-----------------------------------------------------------+';
When I my script, however, the output looks more like this:
+-------------------------------------------------------+ | fake_address1@example.com ARRAY(0x12345678) | | | | fake_address2@example.com ARRAY(0x90abcdef) | ...I do get what is happening here, but is there a way for Perl6::Form to format my data the way I want it to?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Formatting nested data structure in Perl6::Form
by poj (Abbot) on Aug 14, 2014 at 14:37 UTC | |
|
Re: Formatting nested data structure in Perl6::Form
by kennethk (Abbot) on Aug 14, 2014 at 15:18 UTC | |
|
Re: Formatting nested data structure in Perl6::Form
by slothrop (Initiate) on Aug 15, 2014 at 11:27 UTC |