- or download this
$count = () = $data =~ m/and/g;
- or download this
my($next_word) = /and(?=\W*(\w+))/;
- or download this
my @pairs = /(and)(?=\W*(\w+))/g;
- or download this
$_ = 'foo and bar and baz went to the sea.';
my @pairs = /(and)(?=\W*(\w+))/g;
print join "#", @pairs;
- or download this
and#bar#and#baz