perl_seeker has asked for the wisdom of the Perl Monks concerning the following question:
Hi Perl Monks,
I have a perl script which makes use of Tk
As a further level of nesting,in p3.pl
I had written all the code in parts, i.e. all the lower level subs first and then combined
the entire code using require statements.
The code was working fine this way.When I put all the subroutines in main.pl itself and removed
the require statements, I got a lot of Tk errors:
Tk::Error: Can't call method "insert" without a package or object reference at C:\monisha\project\Appliw\s.pl line
124, <EDINP> line 1.
\&main::replace1
(menu invoke)
Tk::Error: Tk::Label=HASH(0x23b8818) is not a Tk object at D:/Perl/site/lib/Tk.pm line 91, <EDINP> line 1.
Tk callback for tkwait
(command bound to event)
Tk::Error: Can't call method "get" without a package or object reference at C:\monisha\project\Appliw\s.pl line 46,
<EDINP> line 1.
\&main::tged
Line 124 is this:
$t->insert('sel.first',"$chosen1");
Line 46:
@chars=$t->get('sel.first','sel.last');
What is the problem here?
Please help.Thanx
:)
I have a perl script which makes use of Tk
p1.pl,p2.pl,p3.pl,p4.pl contain subroutines which are called within subroutine s1.main.pl use Tk; . . . . sub s1 { require p1.pl; require p2.pl; require p3.pl; require p4.pl; . . . .} 1; . . .
As a further level of nesting,in p3.pl
p5.pl,p6.pl,p7.pl,p8.pl contain subroutines which are called within subroutine s2.p3.pl . . . sub s2 { require p5.pl; require p6.pl; require p7.pl; require p8.pl; . . . } 1; . . .
I had written all the code in parts, i.e. all the lower level subs first and then combined
the entire code using require statements.
The code was working fine this way.When I put all the subroutines in main.pl itself and removed
the require statements, I got a lot of Tk errors:
Tk::Error: Can't call method "insert" without a package or object reference at C:\monisha\project\Appliw\s.pl line
124, <EDINP> line 1.
\&main::replace1
(menu invoke)
Tk::Error: Tk::Label=HASH(0x23b8818) is not a Tk object at D:/Perl/site/lib/Tk.pm line 91, <EDINP> line 1.
Tk callback for tkwait
(command bound to event)
Tk::Error: Can't call method "get" without a package or object reference at C:\monisha\project\Appliw\s.pl line 46,
<EDINP> line 1.
\&main::tged
Line 124 is this:
$t->insert('sel.first',"$chosen1");
Line 46:
@chars=$t->get('sel.first','sel.last');
What is the problem here?
Please help.Thanx
:)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Tk question
by benn (Vicar) on Sep 08, 2003 at 12:49 UTC | |
by perl_seeker (Scribe) on Sep 10, 2003 at 06:01 UTC | |
by benn (Vicar) on Sep 10, 2003 at 09:49 UTC | |
by PhilHibbs (Hermit) on Sep 10, 2003 at 10:35 UTC | |
by benn (Vicar) on Sep 10, 2003 at 11:04 UTC | |
by perl_seeker (Scribe) on Sep 15, 2003 at 09:05 UTC | |
by perl_seeker (Scribe) on Sep 22, 2003 at 11:25 UTC | |
by Anonymous Monk on Sep 10, 2003 at 10:47 UTC |
Back to
Seekers of Perl Wisdom