# I need a better way to phrase this. Ideas? $BIGGER_REGEX = qr/ ... /; # The contents of qr// are a constant expression so are compiled at compile-time. sub do_it_again { if ( $sexpert =~ $BIGGER_REGEX ) { ... } } do_it_again(); # the pre-compiled regex is used directly. do_it_again(); # ditto # This qr// was compiled a compile-time. Store a copy in $BIGGER_REGEX. No recompilation # occurs now. $BIGGER_REGEX = qr/ !!! /; do_it_again(); # Like before, a pre-compiled regex is used directly. Nothing special happens.