Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^3: compare two arrays if both are equal and have same elements irrespective of their position

by choroba (Cardinal)
on Jun 16, 2021 at 21:32 UTC ( [id://11133934]=note: print w/replies, xml ) Need Help??


in reply to Re^2: compare two arrays if both are equal and have same elements irrespective of their position
in thread compare two arrays if both are equal and have same elements irrespective of their position

You can write a simple helper sub yourself (or maybe write many of them and upload them to CPAN):
use Test2::V0; sub mybag { my @ar = @_; bag { item $_ for @ar ; end } } is(\@array1, mybag(@array2));
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
  • Comment on Re^3: compare two arrays if both are equal and have same elements irrespective of their position
  • Select or Download Code

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2024-04-19 04:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found