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


in reply to Output Repeats in the elsif statement

if ($carroadnameverify2 =~ /$carroadnameverify/) { ... } elsif ($carroadnameverify2 =~ '') {

From perlop:

The empty pattern //
If the PATTERN evaluates to the empty string, the last successfully matched regular expression is used instead. In this case, only the "g" and "c" flags on the empty pattern is honoured - the other flags are taken from the original pattern. If no match has previously succeeded, this will (silently) act instead as a genuine empty pattern (which will always match).