in reply to Re^2: A graphical regular expression tester.
in thread A graphical regular expression tester.
Yes, it's because you're not doing what you think you're doing with:
$check_switch_i->bind('<Button-1>', \&button_run('now'));
If you run perl -MO=Deparse on that, it'll show you:
$check_switch_i->bind('<Button-1>', \(&button_run('now')));
Which means that you're calling bind with a reference to the results of a call to the subroutine button_run.
What you want, instead (if you're going to use that style of notation), is the anonymous list syntax:
$check_switch_i->bind('<Button-1>', [ \&button_run, 'now' ]);
|
|---|