I’m not sure that I’ll have time to do these every week, but here are my answers to this week’s two Perl Weekly Challenges. Challenge #1 Write a script to replace the character ‘e’ with ‘E’ in the string ‘Perl Weekly Challenge’. Also print the number of times the character ‘e’ found in the string.
1 2 3 4 5 6 7 8 9 10 |
use strict; use warnings; use feature 'say'; $_ = 'Perl Weekly Challenge'; my $count = tr/e/E/; say; say "$count changes"; |
Nothing really complicated here. We can […]