in reply to regex help, please

Marshall pointed you towards a flip-flop approach to the problem and shmem gave you an example flip-flop one-liner where your data was still in a real file rather than a scalar. You can still use the flip-flop method with multi-line data held in a scalar by opening a filehandle on a reference to the scalar and reading it as you would a disk-based file.

$ perl -E ' > $text = <<'EOD'; > CD_DA > > CD_TEXT { > LANGUAGE_MAP { > 0: 9 > } > LANGUAGE 0 { > TITLE "Multi-01" > PERFORMER "" > SIZE_INFO { 1, 1, 19, 0, 3, 2, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 3, 7, 0, 0, 0, > 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0} > } > } > > // Track 1 > EOD > open $tocFH, q{<}, \ $tocFile or die $!; > while ( <$tocFH> ) { print unless m{^CD_T} .. m{^\}} }' CD_DA // Track 1 $

I hope this is of interest.

Cheers,

JohnGG