my $qr=qr/^foo$/; while (length $qr < 1000) { print "$qr\n"; $qr=eval "qr/$qr/" or die $@; }