http://www.perlmonks.org?node_id=970668


in reply to Splitting compound (concatenated) words )

Parsing through a word and making sure that all of its characters are consumed by one of a list of existing words shouldn't be too difficult, however the problem will arise with words that aren't actually concatenated (or can be legitimately split in various ways.) For example the plant cotoneaster has no relationship to fabric, nor christian festivals...

print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."