in reply to Re: error message in the end of the array looping?
in thread error message in the end of the array looping?
Alternatively, if you can get your hands on it, List::MoreUtils has a bunch of small, but useful subroutines.
-----------------------------
use List::MoreUtils qw(any); ... print "Success" if any { $_ eq "correct_value" } @hash{@array};
-----------------------------
Notes:
1 - note the use of a hash slice; it takes some getting used to, having a @ instead of a % in front.
2 - please use something more meaningful than %hash or @array as var names in your actual code :)
In Section
Seekers of Perl Wisdom