in reply to TK Submenus
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
Examples Re: Tk: Creating label in hash
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,
Tutorials: Variable Scoping in Perl: the basics,
Coping with Scoping , Mini-Tutorial: Perl's Memory Management,
Lexical scoping like a fox,
Read this if you want to cut your development time in half!,
Closure on Closures , perlref#Circular References,
Memory leaks and circular references,
Circular references and Garbage collection.,
make perl release memory,
about memory management , Re^3: Scope of lexical variables in the main script , Re: What's the weaken here for?,
Devel::Cycle,
Devel::NYTProf,
Devel::Leak Devel::LeakTrace,
WeakRef
|
---|