Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- my $foo = 'a ba caaa ddd da';
- # power of /g
- $foo =~ m/(?!<=.)\b/gc;
- $foo =~ m/\w(?=.*?\b.)/gc;
- say scalar @{[ $foo =~ m//gc ]};
- # power of eval
- say eval "0*" . ($foo =~ s/(\w+)/'+' . length $1/ger) . "*0";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement