##
#!/usr/local/bin/perl -w
open (DATA, "data.txt") or die "Error";
undef $/; # slurp mode
$body=;
close DATA;
while ( $body =~ /\[(\w+)\]<\/tag1>.*(.*)<\/tag2>/g ) {
print "[$1] => [$2]\n";
}
## ##
[abcd] => [yes]
[efgh] => [1) Foo; 2) Bar; Quux;]
[ijkl] => [Yes]
[mnop] => [Yes, I will. If this and that.]