\&mysub creates a reference to the sub mysub;and by davidj in the same postcalls mysub, then creates a reference to the returned value\&mysub(...)
"When you want to pass arguments to a callbakc, specify an array reference, with the callback code reference as the first element and the callback arguments as the subsequent array elements" In other words: instead ofThus... what happens is instead of binding my_test to 'can', you are executing 'my_test' and binding the result to 'can'. This happens I guess in the main_loop.you need to have$input->bind('<Return>', [\&mysub($arg)]);$input->bind('<Return>', [\&mysub, $arg]);
UPDATE: Fixed format of quoted text
In reply to Re: Tk bind mouse down question
by Sandy
in thread Tk bind mouse down question
by Plankton
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |