Your example is problematic because it's not even perl code. Perl 6 code is actually pretty nifty
for 'dict.txt'.IO.words -> $word {
say "$word probably rhymes with Perl"
if $word ~~ /[ea?|u|i] rl $/;
say "$word is a palindrome"
if $word eq $word.flip;
}