in reply to Compare all array values without a loop
Just for fun here is an evil eval way to do it without a loop.
@a=('A', 'B', 'C', 'D'); $b='D'; if (eval "if(\$b eq \"".(join"\"){return 1}if(\$b eq \"",@a)."\"){retu +rn 1}") { Print "It was there\n" }
Cheers,
R.
|
---|
In Section
Seekers of Perl Wisdom