Update: if the sort is needed the test can be moved into the while loop that does the sort and the final for loop removed.#!perl use strict ; use warnings ; use Data::Dumper; my $refcomp= { 'Ad1' => [ '0A78', '0A9E', '0AB9', '0AC0', ], 'Ad2' => [ '0A78', '0A9E', '0AB9', '0AC0', + ] }; # sort the arrays if not already all in order if ( "sort needed" eq "sort needed" ) { while ( my ( $k, $v ) = each %$refcomp ) { $refcomp -> { $k } = \( sort @$v ); } } # the test my $lastref = ''; for my $curref ( values %$refcomp ) if ( $lastref ) { Dumper( $lastref ) eq Dumper( $curref ) or die "non-unique device list detected"; } $lastref = $curref; }
One world, one people
In reply to Re: Looping through arrays : are they equal ?
by anonymized user 468275
in thread Looping through arrays : are they equal ?
by ZlR
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |