while () { chomp; my ($first_thing, @cmds) = split(/:/,$_); print "$first_thing\n"; print "Individual Elements\n\n"; foreach my $cmd (@cmds) { print " $cmd\n"; } }