my ($match) = $current =~ m/$start(.*)$end/s; # note the parens around $match