in reply to Avoiding multiple *if* statements

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.

I hope this is useful.

Cheers,

JohnGG

Replies are listed 'Best First'.
Re^2: Avoiding multiple *if* statements
by kabeldag (Hermit) on Jul 06, 2008 at 01:56 UTC
    True. I guess I'm just so used to escaping them in an interpolated string. I'm not using the qr operator in the interest of compatibility -- that was a conscious decision.
      Just as a matter of curiosity — compatibility with what? The qr{ } operator has been around for a long time, now.