$string = join('_', map { ( $_ && ( $_ !~ qr(') ) ) ? qq('$_) : $_ } split( q{_}, $string ) );