As ikegami already said above, for the example line of code you give to work, parameter needs to return objects.
If you want to work with objects, it would probably help if you looked at an OO framework such as Moose or e.g. Moo to make writing your classes easier.
If you want to be enlightened on callbacks, closures, iterators, and using code refs in general, Higher-Order Perl is an excellent read.
Either way however, what you are doing seems like it might be a little overcomplicated, but we can't help you with the underlying task if you don't share what that is :-)