Do you know where your variables are? | |
PerlMonks |
Re: TK Submenus (Tk::Menu , global variables/ spirit of strict)by Anonymous Monk |
on Oct 29, 2013 at 00:53 UTC ( [id://1060092]=note: print w/replies, xml ) | Need Help?? |
Some food for thought :) Why don't you use Tk::Menu? There is example at widget - Demonstration of Perl/Tk widgets, Menus : 1. Menus and cascades (sub-menus) Why don't your functions/subroutines take arguments? Why do they work on "global" variables? Slapping "my $globalvariable" on $globalvariable is not in the spirit of strict, but passing( $variables, $around, is( $in, $thespirit, $of, $strict ) ); Write function, functions that take arguments, functions that return values, functions that don't operate on global variables , but functions that pass variables around
Start reading at Re^2: Border-less main window (Alt+F4 Ctrl+C and follow through to examples Re: Perk Tk - how to send a value from a subroutine back to the main program using Button (without MainLoop), Re: Perl tk FindNext in a text widget, Confused by variable scope in Tk::Wizard If you're not convinced by what I'm saying read these links bugs in HTML::TableExtract,
In Section
Seekers of Perl Wisdom
|
|