in reply to unable to call a method reference with an argument

I think the $self->{contents} IS being passed, but is not consumed in the anon sub.

Try:

$self->{txt_box}=txt_box->new( $self->{frm}, sub {$self->updt(@_)} # Pass incoming parms along. );

        Our business is run on trust. We trust you will pay in advance.

Replies are listed 'Best First'.
Re^2: unable to call a method reference with an argument
by Anonymous Monk on Dec 07, 2015 at 23:08 UTC
    The (@_) in "sub {$self->updt(@_)}" worked perfectly. I did try () and ('') to try to force recognition of a single parameter prototype but that didn't work at all and I "solved" the problem by just getting hold of self->(txt_box)->{contents} but wanted to know how to do this for when I can't get at things that way. Thank you very much indeed.