http://qs321.pair.com?node_id=728626


in reply to Little annoying mistakes ... of others

To extend what ikegami said above-

substitute returns true/false and not the changed string even in map

Substitute does not return true/false. It returns the count of substitutions performed.

perl -le '$str = "A.B.C."; $x = $str =~ s/\w//g; print $x' 3 # or a "1" without the "g."