in reply to How do I extract the data that comes after a certain word?

This is probably the simplest way...

my $String = "hello I went to the store yesterday and the day after an +d the day after"; if ($String =~ m{yesterday .+? after}) { print $&; }

perlvar warns though that use of $& can slow down your script considerably. If it's a small script and raw speed is not your prime concern, this is probably acceptable. If performance does become a concern though, the following should also do the trick and is almost as readable...

my $String = "hello I went to the store yesterday and the day after an +d the day after"; if ($String =~ m{(yesterday .+? after)}) { print $1; }
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'