while (){ next unless /\QMSL6000 Trinity:\s*(\d+)/; print OUTFILE $1,$/; }