count-rs-strawberry
Installation
SKILL.md
Count Rs in Strawberry
Count the number of letter 'R' (case-insensitive) in the word "strawberry" using Perl.
Implementation
Use Perl's pattern matching capabilities to count occurrences of the letter 'R':
perl -e 'my $word = "strawberry"; my $count = () = $word =~ /r/gi; print "The word \"$word\" contains $count letter R(s)\n";'