use strict; use warnings; my $str = 'aa~~bb'; my $splBRK = '~~'; my @sect = split /$splBRK/, $str; print "<$_>\n" for @sect;