Your question leaves room for interpretation ;-) My interpretation is, you want to put all combinations into a four column sized table. The following example unfolds the loops using a silly glob hack - don't do that for production code! There are modules on CPAN (e.g. iterator) to create multi-level for-loops.

use strict; use warnings; my $hash_of_excel = [ { col1 => "value1", col2 => "value2", col3 => "value3|value4", col4 => "value5|value6|value7", }, { col1 => "value8", col2 => "value9", col3 => "value10|value11|value12", col4 => "value13|value14|value15", }, { col1 => "value16|value17", col2 => "value19|value18", col3 => "value20", col4 => "value21", } ]; foreach my $results (@$hash_of_excel){ my $glob_expression; for my $colname( sort keys %$results){ my @array = split /\|/,$results->{$colname}; $glob_expression .= '{' . join(',', @array) . '};'; } chop $glob_expression; print "EXP: $glob_expression:\n"; print "\t", join("\n\t", glob $glob_expression), "\n\n"; }

Result:

EXP: {value1};{value2};{value3,value4};{value5,value6,value7}: value1;value2;value3;value5 value1;value2;value3;value6 value1;value2;value3;value7 value1;value2;value4;value5 value1;value2;value4;value6 value1;value2;value4;value7 EXP: {value8};{value9};{value10,value11,value12};{value13,value14,valu +e15}: value8;value9;value10;value13 value8;value9;value10;value14 value8;value9;value10;value15 value8;value9;value11;value13 value8;value9;value11;value14 value8;value9;value11;value15 value8;value9;value12;value13 value8;value9;value12;value14 value8;value9;value12;value15 EXP: {value16,value17};{value19,value18};{value20};{value21}: value16;value19;value20;value21 value16;value18;value20;value21 value17;value19;value20;value21 value17;value18;value20;value21
Did you asked for something like that?


In reply to Re: logical solution for a array of hash by Perlbotics
in thread logical solution for a array of hash by spie287

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.