in reply to what is difference between calling the function in Perl/Tk in the following ways
For a simple command with no args to the sub, I often use:
-command => \&some_sub_name
For a command with args to a sub, I often use:
-command => sub { some_sub_name ($arg1, $arg2) }
The previous is an anon sub that calls some_sub_name(...)
There is no need for the '&' below and I would recommend against it.
-command=>sub { &some_sub_name($arg1,$arg2) }
|
|---|