Hi,

Thanks for your help. But, I thought, I was not clear

in asking my question; sorry for that. I have arrays

of arrays and I want to compare each of the elements

of one array with the elements of the other array.

For example:

@data = (["A", "B", "C", "D", "E", "F", "G"],      ["A","C"],     ["B","F","G"],    ["A","D","E","F","G"], ["D","E","F"], ["G"], ["M", "N", "O"], ["O"], ["M", "N"], ; for $row ( 0 .. $#data ) { for $column ( 0 .. $#{$data[$row]} ) { print "$row $column is $data[$row][$column]\n";    } }

I understand till here how to access elements of

arrays of arrays.I would like to compare each of

the element in the array with the elements of the

next array,and depending upon the number of

matches, I would like to print it in the following

way. Any help in this regard would be

appreciated, as i am trying to get a clear concept

of arrays of arrays.

OUTPUT:

A B C D E F G

A D E F G

B E F

A C

G

M N O

M N

O


In reply to Re^2: comparing the elements of an array by young_perl_learner22
in thread comparing the elements of an array by young_perl_learner22

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.