I'm sorry, but without seeing your code, and your data, the output you get and the output you want, I can't really help you there.
Maybe you can explain things better if you post real, runnable code and data for that program, because for me, the following just works as I imagine it should:
#!perl -w
use strict;
my $data= <<EOM;
firstline
secondline
data_hereDATA THAT IS CAPTURED
EOM
$_= $data;
my($result)= /^data_here(.+)/m;
print $result; # DATA THAT IS CAPTURED
|