in reply to Break a file into seperate files based on string match

$ perl -lanF'\s:\s' -e'print {$F{$F[1]} //= IO::File->new("$F[1].txt", "w")} $F[0]'