App-WordPressTools

 view release on metacpan or  search on metacpan

script/wp-tools  view on Meta::CPAN

}

sub _bre_quote {
    my $str = shift;
    my $bre = shift || '$.*[\]^';
    $str =~ s/([\Q$bre\E])/\\$1/g;
    $str =~ s/\n/\\n/g;
    return $str;
}

# to work around the fact that `tar --transform' can't correctly escape the
# delimiter of a sed substitution expression in the replacement text, this
# subroutine finds a delimiter that can be used safely without escaping
sub _find_sed_delimiter {
    my $str = join('', @_);
    my $bre = '$.*[\]^';
    for my $n (1..255) {
        my $del = pack('C', $n);
        return $del if $str !~ /\Q$del\E/ && $del !~ /[\Q$bre\E]/;
    }
}



( run in 0.275 second using v1.01-cache-2.11-cpan-73692580452 )