You have an error in the regex; too many quantifiers - drop the asterisk, ($last_41) = $buffer =~ /(.{41})$/; You could also do this with substr, $last_41 = substr $buffer, -41;
After Compline,
Zaxo
In reply to Re: Regex to match last n characters of a string
by Zaxo
in thread Regex to match last n characters of a string
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |