Please, could you insert your codes within the tag <code>.You could also see this How do I post a question effectively?=== UPDATE ===
Please, if I may suggest that you always use strict and warnings in your scripts. Moreover, you can check EXAMPLE of this module usage in the Example section of the module.

If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me