in reply to Re: Text::ExtractWords exhibits incomprehensible behavior?
in thread Text::ExtractWords exhibits incomprehensible behavior?
#!/usr/bin/env perl use v5.38; use Text::ExtractWords qw(words_list); say $^V; my $text = "12/21/84 Bob's 21st b'day was a wine-and-dine."; my $copy = $text; say "Text: $text"; say "Copy: $copy"; printf("%s %s\n", \$text, \$copy); my @list; words_list(\@list, $copy, {minwordlen => 2, maxwordlen => 26 }); say "Found words: " . join ' ', map {"[$_]"} @list; say "Text: $text"; say "Copy: $copy"; printf("%s %s\n", \$text, \$copy); __END__ v5.40.0 Text: 12/21/84 Bob's 21st b'day was a wine-and-dine. Copy: 12/21/84 Bob's 21st b'day was a wine-and-dine. SCALAR(0x140829a68) SCALAR(0x1408299d8) Found words: [12] [21] [84] [bob's] [21st] [b'day] [was] [a] [wine-and +-dine] Text: 122184bob's21stb'daywasawine-and-dine Copy: 122184bob's21stb'daywasawine-and-dine SCALAR(0x140829a68) SCALAR(0x1408299d8)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Text::ExtractWords exhibits incomprehensible behavior?
by etj (Priest) on Jun 16, 2024 at 21:54 UTC | |
by ibm1620 (Hermit) on Jun 16, 2024 at 22:14 UTC | |
by etj (Priest) on Jun 16, 2024 at 22:16 UTC | |
by ibm1620 (Hermit) on Jun 17, 2024 at 12:25 UTC |