(F) You can't quantify a quantifier without intervening parentheses. So
things like ** or +* or ?* are illegal. The <-- HERE shows in the regular
expression about where the problem was discovered.
This should work:
use strict;
use warnings;
use diagnostics;
my $last_41;
my $buffer="a"x50;
($last_41)= $buffer =~ /(.*){41}$/;