... while (<$fh>) { next unless m/^[0-9]+ ([^ ]+) [0-9]+ [0-9]+ ([0-9]+)/; push @lines, $2 . '/' . $1; } ...