while () { next unless /^(\d{2}-\d{4}-\d{3})\s+(\d+)\s+(\S+)\s+(\S+)$/; # Not only have we thrown out the garbage, # but the data fields are now in $1..$4 ... more processing ... }