perl -wE' my $string = "abc:def:ghi"; my @array = split /(:)/, $string; say for @array' abc : def : ghi