Not solving your problem but just a point of interest, in your regex, e.g. '(.+)\s\"(.+)\"\s(\d{1,2})' you are escaping the double quotes. That isn't necessary as they are not regular expression metacharacters and you aren't using them in a double quoted string. You might want to consider storing the pre-compiled patterns rather that pattern strings by using qr.