Hi All,
I need to compare two array which has text. i have pasted the code below and i need to compare one array with another array. i have tried multiple ways but if numbers then i got result not with this text.

$inputxml='<Book><Authorgroup><Author><Surname>Lester</Surname><Forena +me>D</Forename><Suffixes>Jr</Suffixes></Author></Authorgroup><Year>20 +09</Year><Book_Title>Writing research papers</Book_Title><Edition_No> +4th</Edition_No><Publisher><Location><State>New York</State></Locatio +n><Name>Longman</Name></Publisher></Book>'; $variance='<Book><aa></aa><AuthorGroup><Author><Surname></Surname>, <F +orename></Forename>, <Suffixes></Suffixes></Author>.</AuthorGroup> (< +Year></Year>). <I><Book_Title></Book_Title></I> (<Edition_No></Editio +n_No> ed.). <Publisher><Location><State></State></Location>: <Name></ +Name></Publisher>.</Book>'; @variance_elements=$variance=~/<([^<\/]+)>/g; @inputxml_elements=$variance=~/<([^<\/]+)>/g;

In reply to compare two string array by Selvakumar

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.