Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Um, so am I!

I take it you want Array::Compare to return the ACTUAL differences between the two arrays? If that is so then you are out of luck, but I am likely to be wrong! According to the module docs:

    In addition to the simple comparison described above (which returns true if the arrays are the same and false if they're different) there is also a full comparison which returns a list of elements which are different. If the arrays are the same it returns an empty list. In scalar context the full comparison returns the length of this list (i.e. the number of elements that differ). You can access the full comparision in two ways. Firstly, there is a DefFull attribute. If this is true then a full comparison if carried out whenever the compare method is called.
So it will return either the number of differences in a SCALAR contect or a list of the elements which differ, whioch in my reading would be a list of the element references. It seems that you are seeing the flattened list and you should treat the return value as a list and see what it contains.

Of course this would be vastly easier if you gave us two small test arays to look at! Could you perhaps include the input array data in a DATA block so we can play with it?

jdtoronto


In reply to Re: Array::Compare issues by jdtoronto
in thread Array::Compare issues by sunadmn

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2024-04-20 00:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found