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.
In reply to Re: Regarding the conditional part of eslif (or if) statement
by moritz
in thread Regarding the conditional part of eslif (or if) statement
by ramjamman
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |