in reply to Extract data from a line with multiple newlines in it

To match .* across multiple newlines, use the //s switch:
if ($test_data_001 =~ /^__BEGIN_DATA__\n(.*)\n__END_DATA__$/s) { # some action }
The //s switch treats the whole string as a single line by allowing . to match a newline.

-Mark

Replies are listed 'Best First'.
Re: Re: Extract data from a line with multiple newlines in it
by sureshr (Beadle) on Feb 11, 2004 at 09:38 UTC
    Thats precisely what I wanted!
    Thanks,
    Suresh R