in reply to a word of warning about /$pattern/

my $address_re = length( $address ) ? quotemeta( $address ) : "(?#)";

No wait, even better - put the comment inside the regex code.

if ( $foo =~ /(?#)\Q$bar\E/ ...