in reply to
Re^2: Multiple foreach loops in single statement
in thread Multiple foreach loops in single statement
...we can provide a list too in split function.
Sorry, no. split operates on a single string (a scalar), but not on a list:
13:57 >perl -wE " $s = q[abc]; $t = q[mno]; say for split(//, $s, $t);
Argument "mno" isn't numeric in split at -e line 1.
14:06 >perl -wE " $s = q[abc]; $t = q[mno]; say for split(//, ($s, $t)
Useless use of a variable in void context at -e line 1.
14:06 >perl -wE " @u = (q[abc], q[mno]); say for split(//, @u); "
The docs however mention EXPR ... which I assumed to be a scalar.
Yes, your original assumption was correct. But split returns a list, which is why the output of split can be the subject of a foreach or a map.
Hope that helps,
Athanasius <°(((>< contra mundum