As an addendum -- in case it's not clear for the OP or others -- this works because substr used in the way described takes up to as many characters specified (e.g. 500 in this case). If used on a string shorter than the maximum length, there is no padding added at the end. Thus length works on the summary exactly as one would expect.
-xdg
Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.
In reply to Re^2: Counting Characters
by xdg
in thread Counting Characters
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |