I wonder how the $1 =~ tr/\n// in your solution doesn't die with "modification of a readonly value attempted"?This special form of tr with an empty replacement list is used to count the number of characters. Example from perlop:
In perlfaq4, they give an example indicating that this idiomatic use of tr is the canonical Perl way to count the number of characters in a string. Admittedly, apart from these examples, I can't find an explicit statement in the docs that this special form of tr does not attempt to modify the string.$cnt = tr/0-9//; # count the digits in $_
In reply to Re^2: Changing quoted strings spanning more than one line
by eyepopslikeamosquito
in thread Changing quoted strings spanning more than one line
by eyepopslikeamosquito
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |