perl -d scream.pl
####
DB<1> l
5==> my $text = "my text [and maybe|and here's] more text [the end|stop]";
6: my @arr = parseit($text);
7: print "$_\n" for @arr;
8
9 sub parseit {
...
####
DB<1> b 7
DB<2> r
main::(scream.pl:7): print "$_\n" for @arr;
DB<2>
####
DB<2> p @arr
my text and maybe more text the endmy text and maybe more text stopmy text and h
ere's more text the endmy text and here's more text stop
DB<3>
####
DB<3> x @arr
0 'my text and maybe more text the end'
1 'my text and maybe more text stop'
2 'my text and here\'s more text the end'
3 'my text and here\'s more text stop'