#!/usr/bin/perl
$str = 'banana';
$foo = 'na';
#$str =~ s{/$foo/ge} s{/./-/g}e;
$str =~ s/$foo/$&=~s#.#-#gr/ge;
#$str =~ s/($foo)/$1=s|.|-|rg/egi;
IyEvdXNyL2Jpbi9wZXJsCgokc3RyID0gJ2JhbmFuYSc7CiRmb28gPSAnbmEnOwojJHN0ciA9fiBzey8kZm9vL2dlfSBzey8uLy0vZ31lOwokc3RyID1+IHMvJGZvby8kJj1+cyMuIy0jZ3IvZ2U7CiMkc3RyID1+IHMvKCRmb28pLyQxPXN8LnwtfHJnL2VnaTsKcHJpbnQgJHN0cjs=