$String = "hello I went to the store yesterday and the day after and the day after";
I only want to print the words i went to the store
. I tried two ways, neither worked:
if ($String =~ /hello/i) {
until ($String =~ /yesterday/i) {
print "Summary: $'"
}
}
This printed the entire string. I used the $' function, but it took too much data. How do I limit it?
What if I wanted to print only "yesterday and the day after"? How would I be able to start matching the script in the middle?