my @sections = $str =~ m/^===Comments===\n(.*?)\n=.*?=$/gms;
print Dumper(\@sections);
print "\n\nOR\n\n";
my %sections = reverse( $str =~ m/^===Comments===\n(.*?)\n=(.*?)=$/gms );
print Dumper(\%sections);
print "\n\nOR\n\n";
while($str =~ m/^===Comments===\n(.*?)\n=(.*?)=$/gms) {
print " $2 : $1\n";
}
####
$VAR1 = [
'
User comments are added here. A user may write whatever they may wish.
',
'
Comments are related to the microarray data here.
',
'
Comments related to the pathway information here.
'
];
OR
$VAR1 = {
'Microarray Data' => '
User comments are added here. A user may write whatever they may wish.
',
'Pathway Information' => '
Comments are related to the microarray data here.
',
'Aditional Info' => '
Comments related to the pathway information here.
'
};
OR
Microarray Data :
User comments are added here. A user may write whatever they may wish.
Pathway Information :
Comments are related to the microarray data here.
Aditional Info :
Comments related to the pathway information here.
####
my %x = map {
/^=([^\n]*)=\n.*\n===Comments===\n(.*)$/s ? ( $1 => $2 ) : ()
} split(/(?=^=[^=])/m,$str);
print Dumper(\%x);
####
$VAR1 = {
'Microarray Data' => '
Comments are related to the microarray data here.
',
'Pathway Information' => '
Comments related to the pathway information here.
',
'Literature' => '
User comments are added here. A user may write whatever they may wish.
'
};