in reply to Re: If Simplification
in thread If Simplification

Or if you want to do the same thing in both cases, you can do with only a single evaluation:
if( $ENV{REQUEST_URI} =~ $regex ? $ENV{REQUEST_URI} =~ $regex2 : 1 ) { # ... }
Which reads a lot less awkwardly using $_.
local $_ = $ENV{REQUEST_URI}; if(/$regex/ ? /$regex2/ : 1) { # ... }
In other words, if matching $regex succeed, then it depends on whether it matches $regex2, if it failed, then it's always true.

Makeshifts last the longest.