The advice in brian's Guide to Solving Any Perl Problem might help you.
In reply to Re: Empty variables in insertion in mongodb by ig in thread Empty variables in insertion in mongodb by jhanquar