Hi tsk1979, Try this,
use strict; use warnings; use Array::Compare; my @ar1 = qw(-true -depth=1); my @ar2 = qw(-search -depth=1 -true -expand_all); my $comp = Array::Compare->new(); if ($comp->compare(\@ar1, \@ar2)){print "Same Array OK";}else{print " +Different Array OK";}
Updated davorg solution is correct. compare function compare the arrays in order.
Regards,
Velusamy R.
In reply to Re: Finding wether all elements of one array are in another
by Samy_rio
in thread Finding wether all elements of one array are in another
by tsk1979
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |