I answered this question, and to demonstrate my answer a wrote some code, and finally found myself posting a whole module in the answer. I faced some difficulties indenting the code. I wonder if
there a place where one can submit examples as whole modules so users can download, install and run immedaitly instead of putting the whole modules in the questions or within an answer, and when the user copies the module to their local he has to adjust the indentation.