use strict; use warnings; my @a = qw(-true -depth=1); my @b = qw(-search -depth=1 -true -expand_all); print '@b contains @a' if @a == grep defined, @{{map {$_=>$_} @b}}{@a};