http://www.perlmonks.org?node_id=1055647


in reply to Unable to extract matched string from input

Rather than splitting on whitespace since there is whitespace in the descriptions as well, why not just split the whole data chunk with a regex from the start. Assuming that your entries are always formatted with the chr, start, end, and description, you could do something like:
my ( $chr, $start, $end, $description ) = $annotation_line =~ /(chr\d+ +) (\d+) (\d+) (.*)/; if ( $description =~ /dgv_Cnv=True,overlap=\d+\.\d+%;/ ) { print "$chr\t$start\t$end\t$&\n"; }