$ perl -wE 'my ($p, $f) = (A => "x"); my $re = qr{(?$f: $p )}; say $re' (?^u:(?x: A ))