in reply to Re^2: Formatting quotes in a String
in thread Formatting quotes in a String

.can you please get me through how this is working
Your tests are not adequate to understand choroba's suggested code. Try this (demonstrated here under the Perl debugger):
DB<1> $string = 'Tetsing " code implementationm'; DB<2> $result = $string =~ tr/"//; DB<3> p $result 1 DB<4> p $string Tetsing " code implementationm
In essence, choroba is testing the value that ends up into $result in the code above. And it adds a quote mark at the end of the string if the value returned by tr/// is odd (meaning that quote marks are unbalanced).

Replies are listed 'Best First'.
Re^4: Formatting quotes in a String
by pavan474 (Novice) on Dec 02, 2016 at 12:07 UTC

    Thanks, Laurent_R

    I got how this is working