One solution in this specific context is to use the /e modifier twice
#!/usr/bin/env perl
use strict;
use warnings;
my $st = 'abcd';
my $grep1 = 'a(bc)d';
my $grep2 = '$1';
$st =~ s/$grep1/$grep2/ee;
print $st,"\n";
Outputs:
bc
To make it a little less fragile, I'd recommend enclosing your RHS in two sets of quotes though:
$st =~ s/$grep1/qq{qq{$grep2}}/ee;
Note: As ikegami mentioned, evaling unsantized input is extremely dangerous. I would therefore not recommend this in a general context. Also, there are likely better solutions available to you, but you would first have to unravel your XY nature of question.