I think substr is doing exactly what you're asking it to.
You've set the offset to -1. That means, "Start at the last character on the string." From the last character of the string to the last character + $length characters is still only going to return the last character.
What had you hoped to get instead?
In reply to Re: substr problem
by DamnDirtyApe
in thread substr problem
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |