in reply to strange quotes
When I ran your program I got the "Expected" ouput rather than the "REAL" output. Perhaps your data source was different.
Just a few comments:
It would be better to use \d and \w in the date matching regex.I would rewrite the main block of your code something like this:
It would be better to use a negated character class to match the Inron/Exon data.
On the main loop it is better to use while instead of foreach
Braces don't have to be escaped in a quoted string.
--while (<INFO1>) { if (/^DATE\s*(\d+)-(\w+)-(\d+)/) { print qq{\nDATE\t"$1-$2-$3"\n}; } elsif (/\s*\/intron="([^"]+)/) { foreach my $item (split('\;',$1)) { print "Intron\t{Translation%$item}\n"; } } elsif (/\s*\/exon="([^"]+)/) { foreach my $item (split('\;',$1)) { print "Exon\t{Translation%$item}\n"; } } }
|
|---|