E:\Temp>perl -Mstrict -we "my $foo=7;die qq(matched '$&'\n) if '1234567rab_.'=~/[${foo}bar]+/" matched '7rab'