#!/usr/bin/perl use strict; use warnings; my @must_have=qw(abc def ghi); my @to_check = @must_have[0,1]; # only the first two elements my %lookup = map {$_, 1} @to_check; # lookup hash my $flag = 1; for (@must_have) { next if $lookup{$_}; $flag = 0 } print "flag not set" if not $flag
In reply to Re: comparing some data form the elements of an array
by svenXY
in thread comparing some data form the elements of an array
by s_gaurav1091
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |