$a and $b are read-only in a sort block.
@list = sort { $a = 1; } @list;
You're getting the error because you are attempting to auto-vivify them.
I hate auto-vivification, or at least that it's on by default.
In reply to Re^3: read-only error
by ikegami
in thread read-only error
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |