in reply to one line regexp problem

How about:

# Keeps newlines. my $str = q~ ... ~; my @fetch = grep { /test/ } ($str =~ m#(<IPDR>.*?</IPDR>)#sxgi); print(scalar(@fetch), "\n"); print join("\n---\n",@fetch);

or:

# Removes newlines. my $str = q~ ... ~; my @fetch = map { local $_=$_; s/\n+//g; $_ } grep { /test/ } ($str =~ m#(<IPDR>.*?</IPDR>)#sxgi); print(scalar(@fetch), "\n"); print join("\n---\n",@fetch);