From 4ed0b75f146ea4e23bd2ddc0664c25f4feec573c Mon Sep 17 00:00:00 2001 From: martinahansen Date: Mon, 21 Jul 2008 06:58:01 +0000 Subject: [PATCH] fixed ugly bug in get_record git-svn-id: http://biopieces.googlecode.com/svn/trunk@184 74ccb610-7750-0410-82ae-013aeee3265d --- code_perl/Maasha/Biopieces.pm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/code_perl/Maasha/Biopieces.pm b/code_perl/Maasha/Biopieces.pm index 589cab9..d375e2d 100644 --- a/code_perl/Maasha/Biopieces.pm +++ b/code_perl/Maasha/Biopieces.pm @@ -5918,7 +5918,7 @@ sub get_record # Returns data structure. - my ( $block, @lines, $line, %record ); + my ( $block, @lines, $line, $key, $value, %record ); local $/ = "\n---\n"; @@ -5932,10 +5932,9 @@ sub get_record foreach $line ( @lines ) { - # ( $key, $value ) = split ": ", $line; # ooops, this one is buggy! - if ( $line =~ /^([^:]+?):\s+(.*)/ ) { - $record{ $1 } = $2; - } + ( $key, $value ) = split ": ", $line, 2; + + $record{ $key } = $value; } return wantarray ? %record : \%record; -- 2.39.5