http://www.perlmonks.org?node_id=1062468


in reply to Help choosing the most efficient, dependable condition(al)

Without trying to dumpster-dive into this particular debate, I would note that it is easy to avoid messages like “use of uninitialized value” through the use of the && (logical-AND) operator, which uses so-called short circuit evaluation:   if the left-hand side is False, the right-hand side is not evaluated at all.   (See perldoc perlop.)

Thus, you can say (say...):
if ( $ENV{'HTTP_ACCEPT'} && ( $ENV{'HTTP_ACCEPT'} =~ ...

undef is always False.   So, the statement quits right there and the remainder of the expression is never evaluated.