<?xml version='1.0'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:atom="http://www.w3.org/2005/Atom" >
<channel>
	<title><![CDATA[BOL: Extract the values between to user defined string with Perl]]></title>
	<link>https://bioinformaticsonline.com/snippets/view/35340/extract-the-values-between-to-user-defined-string-with-perl?</link>
	<atom:link href="https://bioinformaticsonline.com/snippets/view/35340/extract-the-values-between-to-user-defined-string-with-perl?" rel="self" type="application/rss+xml" />
	<description><![CDATA[]]></description>
	
	<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/35340/extract-the-values-between-to-user-defined-string-with-perl</guid>
	<pubDate>Wed, 24 Jan 2018 16:18:10 -0600</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/35340/extract-the-values-between-to-user-defined-string-with-perl</link>
	<title><![CDATA[Extract the values between to user defined string with Perl]]></title>
	<description><![CDATA[<code>#!/usr/bin/perl -w
use strict;

while (&lt;DATA&gt;)
{
    process_record() if /^\s*START/;
}

sub process_record
{
   my $line;
   while (defined ($line = &lt;DATA&gt;) and $line !~ /^\s*END/)
   {
      print &quot;$line&quot;
   }
   print &quot;\n&quot;;  #a printout spacer for next record
}

__DATA__

XXXX
YYYY
START
These are the first
set of lines
which are to be extracted
END
   START
New line
And new
Will be extracted?
END
XXX
ZZZ
YYY
START
These are the second
set of lines
which are to be extracted
END
aasds
tteret
tertetr</code>]]></description>
	<dc:creator>Jit</dc:creator>
</item>

</channel>
</rss>