in reply to Regarding the conditional part of eslif (or if) statement

Is it possible to use foreach in the conditional part of a elsif statement?

No. for and foreach are not expressions, but expressions statements, thus can't be used where a return value is expected.

But you can always use map, grep or any or all, the last two from List::MoreUtils. In Perl 5.10 and newer the smart-match operator might also be a good choice.

Perl 6 - links to (nearly) everything that is Perl 6.