Fix perlcritic ProhibitCaptureWithoutTest
This can cause random issues in production when global $1, $2 are used after an expression that didn't match.
This can cause random issues in production when global $1, $2 are used after an expression that didn't match.