Subject: | Wishlist: split as an lvalue |
So that I can write:
for (split //, $string) {
/!-~/ and ord &= ~0x20, ord |= 0xff00;
}
:-)
Unfortunately, split is not overridable, so it involves a bit of work. Any of these approaches should work:
1) Use the keyword plugin interface.
2) Override PL_check[OP_SPLIT].
3) Export a lexical subroutine, since they override everything.
You would need XS code to handle special first argument. Returning substr() lvalues is a SMOP.