Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: Check if sort has changed order

by LanX (Saint)
on May 10, 2013 at 12:37 UTC ( [id://1032953]=note: print w/replies, xml ) Need Help??


in reply to Re: Check if sort has changed order
in thread Check if sort has changed order

> This link will help.

Actually it will not!

The SO question is about comparing unordered sets, while the OP explicitly needs to assure that the order of identical sets didn't change.

Cheers Rolf

( addicted to the Perl Programming Language)

Replies are listed 'Best First'.
Re^3: Check if sort has changed order
by Rahul6990 (Beadle) on May 10, 2013 at 12:54 UTC
    You can apply array_diff function on the sorted and unsorted file and check the output file to see weather sort had done any modification or not.
      > You can apply array_diff function on the sorted and unsorted file and check the output file to see weather sort had done any modification or not.

      Unlikely, please demonstrate an example of how you intend to do it with Array::Utils

      I mean real code!

      Cheers Rolf

      ( addicted to the Perl Programming Language)

      update

      as expected, pure nonsense!

      DB<110> use Array::Utils qw(:all) DB<111> @a = (8..12); @b = sort @a; @c = (@b,42) => (10, 11, 12, 8, 9, 42) DB<112> array_diff @a,@b DB<113> array_diff @a,@c => 42

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1032953]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-03-29 10:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found