in reply to Object Oriented Callback

In addition to ikegami's wonderful advice, you should also be including use strict; and use warnings; to catch simple headaches. There's some reference material you may find valuable in perlref on callbacks (search term coderef). To store a code reference in a hash and call it, you can do the following:

my %hash = (code => sub{print 'x'}); &{$hash{code}};

Replies are listed 'Best First'.
Re^2: Object Oriented Callback
by zaebst (Initiate) on Dec 17, 2008 at 06:19 UTC
    Thanks guys. After fixing the subroutine call, I found one more problem and got things working. I switched pre tags to c tags as well.