I was doing a perl/tk program and I realize I didn't have "use strict;" in my code. When I added it, I got this error message:
Name "main::address" used only once: possible typo at sorcerer.pl line 26.
Not a reference 0 at C:/Perl/site/lib/Tk/Widget.pm line 188.
Tk::Widget::new('Tk::Radiobutton', 'Tk::Frame=HASH(0x240f2b8)', '-variab
le', 0, '-command', 'ARRAY(0x234f2e0)', '-text', 'Calling My Opponent At', ...)
called at C:/Perl/site/lib/Tk/Widget.pm line 247
Tk::Widget::__ANON__('Tk::Frame=HASH(0x240f2b8)', '-variable', 0, '-comm
and', 'ARRAY(0x234f2e0)', '-text', 'Calling My Opponent At', '-value', ...) call
ed at C:/Perl/site/lib/Tk/DialogBox.pm line 74
Tk:ialogBox::add('Tk:ialogBox=HASH(0x24128c4)', 'Radiobutton', '-var
iable', 0, '-command', 'ARRAY(0x234f2e0)', '-text', 'Calling My Opponent At', ..
.) called at sorcerer.pl line 115
The source code is attached. I think the problem is somewhere in this area, though.
use strict forces you to be using more appropriate code and makes the interpreter recognise a more "strict" syntax, your code then doesnt adhere to that syntax. Make sure its all done well (and indented so you can see what your doing well).
From my little knowlege of tk, isnt the -command attribute only supposed to take one arguement?, and shouldnt it be pack() instead of place() ?
I figured out the problem, it was with the lack of a \ in front of the $type. Place is a more specific version of pack and the first argument of command is the sub to call and the second is the argument to pass to the sub. Now I have most of the problems fixed. However, I am making a at program and IO:elect doesn't work to keep it from not responding to the GUI. Actually, I am using Active State Perl 5.8.0 for Win32 and IO:elect doesn't seem to work.