in reply to Find text between two strings?

I recommend you read the regex tutorial.

It could be something like this (precise form of regex depends on the interpretation of your question, please read the link):

my $input = "foodogbar"; my ($thing) = $input =~ /foo(.*?)bar/;