use Quantum::Superpositions; my $first = any(@routers); my $second = any(@interfaces); if ( ($first_arg eq $first) and ($second_arg ne $second)) { # .. do stuff .. # }