in reply to Re^2: remove chars with regex
in thread remove chars with regex

To remove the middle instead of keeping the middle, you could use

substr( $char, 5, -5, "" ); # In-place
or
my $output = substr( $char, 0, 5 ) . substr( $char, -5 );