in reply to Trying to split a file into array conditionally

Perhaps you could only split where the next line doesn't start with an opening square bracket?

split takes a regex, thus this is fairly easy.

@info = split /\n(?!\[)/, $filecontents;

Replies are listed 'Best First'.
Re^2: Trying to split a file into array conditionally
by bobg2011 (Novice) on Nov 16, 2011 at 09:42 UTC
    Thanks guys...... I've gone with brats solution.... it does the trick nicely! cheers! :)