in reply to split based upon string

use warnings; use strict; local $/ = 'DELIMITING_TEXT'; my @array = <DATA>; chomp @array; local $" = '|'; print "@array\n"; __DATA__ some junk DELIMITING_TEXT test1 test2 test3 test4 DELIMITING_TEXT test1 test2 test1 test2 test1 test2 DELIMITING_TEXT test1 test2 DELIMITING_TEXT some junk
What you do not say is what you want to do with the new-lines at the end of each data item. A for loop is probably called for to remove them, but replace them with what?

Replies are listed 'Best First'.
Re^2: split based upon string
by mrdvt92 (Acolyte) on Feb 05, 2010 at 04:23 UTC
    This looks alot like a MIME mail message format. Have you searched CPAN for a MIME parser. Like "MIME::Parser".