use strict; use Benchmark::Timer; use Filt; our $t = Benchmark::Timer->new(); my $short_line_threshold = 2; my $short_line_counter = 1; my $long_line_threshold = 7; my $tmp = "Abcdef"; $tmp =~ s/((?:\s*(?:.{1,$short_line_threshold})<\/line>\s*){$short_line_counter,})(\s*(?:.{$long_line_threshold,}?)<\/line>)/$1<\/para>$2/gs; print $t->report();