in reply to Check exist of anonymous subroutine before calling it within regexp substitute?
my $default = sub { '' }; ... ($out_message = $log_format) =~ s/%(.)/($meta_char{$1} || $default)->( +)/ge;
This replaces unknown escape sequences with an empty string.
|
|---|