Advertisement
happy-barney

83

Nov 3rd, 2020 (edited)
356
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. my $foo = 'a ba caaa ddd da';
  2.  
  3. # power of /g
  4. $foo =~ m/(?!<=.)\b/gc;
  5. $foo =~ m/\w(?=.*?\b.)/gc;
  6. say scalar @{[ $foo =~ m//gc ]};
  7.  
  8. # power of eval
  9. say eval "0*" . ($foo =~ s/(\w+)/'+' . length $1/ger) . "*0";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement