use strict; use warnings; my $line = "This is :a line :with colons :in it"; my @items = split /:/, $line; print "$_\n" foreach (@items);