in reply to Re: unable to call a method reference with an argument
in thread unable to call a method reference with an argument

"My guess would be that the $self variable you are calling update on in your sub is a different variable than the $self object that contains contents." Yes but they should be. The suggested addition of "(@_)" as in... $self->{txt_box}=txt_box->new( $self->{frm}, sub {$self->updt(@_)} ); has fully solved the problem. Thank you for your suggestions.
  • Comment on Re^2: unable to call a method reference with an argument

Replies are listed 'Best First'.
Re^3: unable to call a method reference with an argument
by Anonymous Monk on Dec 07, 2015 at 23:40 UTC
    Just to clarify... The $self that goes with updt is implicit in the value of the attribute $self->{sub_to_call_on_keypress} whereas the $self explicit in the the above attribute is the SAME self that is also explicit in the attribute $self->{contents}