in reply to How to Do Multiple OR in For Loops

I'd go for
my $tp = grep { $myhash{ $_ } } @pred;

If the boolean needs to be formatted into '0' and '1' for output, that's the output code's job, and it can be done there trivially using « ? '1' : '0'».

Using "for", it would look like

my $tp = 0; for ( @pred ) { if ( $myhash{ $_ } ) { $tp = 1; last; } }
or
my $tp = 0; for ( @pred ) { last if $tp = $myhash{ $_ }; }