I have a hard time coming up for good reasons ever to change $[ from its default.
The only situation I can imagine, and it's a very farfetched one, is if I am translating from a non-zero-based indexing language (like Fortran) into Perl some extremely complex algorithm that I barely understand and that has lots of array index manipulations. In such a rare situation, for the sake of avoiding translation mistakes I may set $[ to 1. But even this would be temporary; ultimately, with a sufficiently solid test suite to back me up, I'd refactor the whole thing to 0-based indexing.
I'd be curious to know if any other monk has found any other use for a non-zero $[.
the lowliest monk
In reply to Re: $[ is under respected.
by tlm
in thread $[ is under respected.
by EvanCarroll
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |