Why this is not working as I expected?
$ echo 'JOHN, BO PEEP, BoPeep' | perl -0777ne 'map { print ($_) if $_ ne uc($_) } split /,/'
BoPeep
$ echo 'JOHN, BO PEEP, BoPeep' | perl -0777ne 'map { print lcfirst($_) if $_ ne uc($_) } split /,/'
BoPeep
The only difference between the two commands is print ($_) vs print lcfirst($_), while I was expecting that print lcfirst($_) would output boPeep instead.
What am I missing?
Sample input:
JOHN, BO PEEP, BoPeep, AVG, Hex_String_Literal, Time_String, MODULE