my $text = ' , I, and B> text.'; #### $VAR1 = [ '', ', I, and B> text.', ' ' ]; #### my @line = extract_bracketed($text, '<>', qr(.*?(?=<))); #### $VAR1 = [ '', ', I, and B> text.', 'A line with B' ];