in reply to compare two arrays if both are equal and have same elements irrespective of their position
#!/usr/bin/perl use warnings; use strict; use feature qw{ say }; use List::Util qw(shuffle); use Test::Deep::NoTest qw{ eq_deeply bag }; my @array1 = shuffle(1..100); my @array2 = shuffle(@array1); say eq_deeply(\@array1, bag(@array2)); # 1
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: compare two arrays if both are equal and have same elements irrespective of their position
by jo37 (Curate) on Jun 16, 2021 at 20:55 UTC | |
by choroba (Cardinal) on Jun 16, 2021 at 21:32 UTC |