if ( $line =~ m/from=<\s*(.*?)>.*?to=<\s*(.*?)>/ ){ push(@output, substr( $line, 0, 15 ) .' : '. $1 . '::'.$2) }