At compile time, perl doesn't know that the eval string will close over $sep, so it doesn't. If you changed it to a normal closure, it ought to work.
Arguably this is or is not a bug. (If you think it is a bug, please post an algorithm that reliably fixes the bug. Good luck.)
In reply to Re: A 'print' at one spot changes a value at another
by chromatic
in thread A 'print' at one spot changes a value at another
by ralphmerridew
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |