if ($mystr =~ /Total lines processed:\s+(\d+)/) { my $total = $1; return $total; } print "TFD> \e[7mUnexpected format of 'mystr':\e[m\n"; print "TFD> '$mystr'\n";