in reply to what is difference between calling the function in Perl/Tk in the following ways
Any one can explain me what is the difference between in the above two ways.
In the 1st, you pass a code ref and args to pass to the code ref.
In the 2nd, you pass a code ref but no args. Instead, you rely on a closure to pass data.
I presume you're really asking which one you should use. Whichever you prefer. The latter can be simpler and more natural in Perl, but the former is required for other languages where the latter is impossible to do.
|
|---|