actually i have found that using my(undef, $data_needed)=split(/(.+)/,$_); works if you have nothing after the pattern match. if its just my($data_needed)=(/^(.+)/,$_); it will put the whole paragraph into $data_needed for some reason. but this is just for me, and someone else may be different