Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re^3: Passing arguments to event handlers in WxPerl (is something you never have to do; wx-combobox-event.pl)by Anonymous Monk |
on Sep 20, 2014 at 07:10 UTC ( [id://1101343]=note: print w/replies, xml ) | Need Help?? |
Put it in a subroutine , call subroutine and give it args, have subruotine return values, subroutines are easy to call repeatedly , programming is all about well named suboutines calling each other .... and zero global variables The key is to put everything into well named subs :) subroutines that take arguments, not work with "fake" global variables , file scope my globals, lexical globals , global lexicals, fake globals they nullify the helpfulness of strict :) read about it http://perl.plover.com/flagbook/yak/Chi/slide040.html
Tutorials: Variable Scoping in Perl: the basics,
In Section
Seekers of Perl Wisdom
|
|