if ( length($short) + length($parts[0]) <= $len ) { $short = join( ' ', $short, shift @parts ); }
The length is off by one because you add not only the part, but a new space as well. The easy fix is to delete the = from <= $len
In reply to Re^2: substr question
by rowdog
in thread substr question
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |