i wish to read a file, while file the content match the pattern, then substitute it.Now i only able to match it.

My code:
==============
#!c:/perl/bin/perl
use CGI qw(:standard);
$id="_shop";
open (F,"image.pl") or die $!;
{ local $/; $bfr = <F>;
if($bfr=~m/\#<start$id>([\w\W]*)\#<end$id>/gsi)
{
$m=$1;
s/$m//; #not work
s/\#<start$id>//; #not work
s/\#<end$id>//; #not work

}
}
close F or die $!;

========================


image.pl's content:
=========================
#!c:/perl/bin/perl
use CGI qw(:standard);

#<start_shop>
$name="shop";
$id="111";
#<end_shop>

============

i wish to substitute the whole part of:
#<start_shop>
$name="shop";
$id="111";
#<end_shop>