It's not the shebang, it's the -w switch. Take out -w and only use use warnings instead and the error goes away because warnings is lexically scoped but -w is global. Using -w turned warnings on globally which is why your error came from the debugger code as it told you.
I don't know why the action is executed on each line of the loop; I agree that docs indicate that it should be executed only on that line each time through the loop.
Update: Realized the example code had both -w and use warnings.
In reply to Re^3: Debugger actions: On which lines?
by 1nickt
in thread Debugger actions: On which lines?
by worik
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |