Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Hi Perl Monks,
I have a perl script which makes use of Tk
main.pl use Tk; . . . . sub s1 { require p1.pl; require p2.pl; require p3.pl; require p4.pl; . . . .} 1; . . .
p1.pl,p2.pl,p3.pl,p4.pl contain subroutines which are called within subroutine s1.

As a further level of nesting,in p3.pl
p3.pl . . . sub s2 { require p5.pl; require p6.pl; require p7.pl; require p8.pl; . . . } 1; . . .
p5.pl,p6.pl,p7.pl,p8.pl contain subroutines which are called within subroutine s2.

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
:)

In reply to Tk question by perl_seeker

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2024-04-16 07:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found