in reply to RegEx & Approach Question
Using an alternate delimiter for your regex would make it easier on the eye, and would avoid LTS (Leaning Toothpick Syndrome). Instead of "/", you could use "{}", for example:
m{ Input queue: 0/75/(.*)/39 \(size/max/drops/flushes\); Total ou +tput drops: (.*)}
Also consider making portions of the regex independent of whitespace. You could start the regex with m{\s+Input
The $1 alone looks a little suspicous. If the regex matches, then $1 should be set, so checking it again seems redundant. Did you really mean if (($1 != 0) || ($2 != 0))
If your captures should always be integers, it might be better to use (\d+) instead of (.*).
|
|---|