Perl Weekly Challenge: 2019–03–25
Dave Cross
31

I have to say your Fizz Buzz solution is very elegant! I understand that you felt you had to change your code a little to accomodate for the whitespace. I wonder why you chose to the modifications you did instead of just add a space at the end of buzz? Like this…

perl -E 'say +("fizz ")[$_ % 3] . (buzz)[$_ % 5] || $_ for 1 .. 20'

I guess some would say that — although invisible — printing an unnescessary character when only Fizz hits, is not very elegant. Was that your thinking as well?