This is neat, but was certainly not obvious. Maybe it is worth reminding that indeed substr can be used as a lvalue, as explicitely said in its perldoc:
You can use the substr() function as an lvalue, in which case EXPR must itself be an lvalue. If you assign something shorter than LENGTH, the string will shrink, and if you assign something longer than LENGTH, the string will grow to accommodate it. To keep the string the same length, you may need to pad or chop your value using "sprintf".
| [reply] [Watch: Dir/Any] |
| [reply] [Watch: Dir/Any] [d/l] [select] |