Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re^3: u+ fails to force scalar context to empty list assignment: +( () = ... )by Marshall (Canon) |
on Mar 12, 2019 at 00:30 UTC ( [id://1231142]=note: print w/replies, xml ) | Need Help?? |
fair enough, both work. As an update, string concatenation can be used in other situations to force scalar context so it is valid to mention that possibility. In this particular case, 0+ is perfect. However if the goal is only to count ";", tr is even better.
In Section
Seekers of Perl Wisdom
|
|