in reply to Read-only variable in foreach loop?
I'm not exactly sure what you're trying to do here,
but the $1, $2 etc. variables are used for holding
the results of RegEx parens matches. The $i in the
foreach loop is taking a reference to each one of them
in turn. I tried the snippet substituting $a, $b for
the $1, $2 etc. and didn't get the error.
Hopefully one of our senior monks can gives us a more
indepth explanation...
"all was created from /dev/null and shall return to /dev/null"