in reply to Simple error

Your files and installation seem fine.

It is complaining about line 235 in test.txt.

That line apparently calls a function in Tk::Widget, passing "text".
The function in Tk::Widget is upset by that, and rejects it.

             I hope life isn't a big joke, because I don't get it.
                   -SNL

Replies are listed 'Best First'.
Re^2: Simple error
by Jshelton31 (Initiate) on Jun 13, 2012 at 01:25 UTC
    Could you suggest a fix, greatly appreciated. I am not sure how to adapt versions as my skills are young. Looking forward to critiques after fix:

      Jshelton31:

      It complained about unknown option "text". When I looked at the Tk docs (I've not played with it before), I noticed they frequently prefix hyphen on the options. When I looked your code over, I saw that in most places, there were hyphen prefixes. So I added a few hyphens, and the code brought up a window. There were two "text" options needing a hyphen, and a "width" and "height".

      ...roboticus

      When your only tool is a hammer, all problems look like your thumb.

      Jshelton31: Welcome to the Monastery.

      The recommended max length for posted code is something on the order of 15-20 lines (with the provisos that

      • The code posted is compilable (passes perl -c script.pl), executable, and produces the same result with which you're dissatisfied
        and
      • When necessary, the posted code may be an adaption of a single small part of a larger program

      TTBOMK, NodeReaper has never thrown a violator into the catacombs... permanently, that is. On the other hand, however, some Monks -- this one specifically included -- will not invest hours to solve a problem presented with some 1278 lines of code. Fifteen or twenty lines, yes; on a good day, maybe even more. But not 1278.

      So, if you can, create a snippet illustrating the problem. And if the problem is so recalcitrant that you can't demonstrate it in 15 or 20 lines, read Markup in the Monastery, with special attention to the <readmore> tag set.

        You're wrong

        Also, you could have answered the question fifty times in the time its taken you to type up that junk

        $ lwp-download "http://perlmonks.com/?displaytype=displaycode;node_id= +975895" foobar.pl 46.3 KB received in 1 seconds (46.3 KB/sec)

        $ ack -A0 "[^-]\btext" NUL foobar.pl ack: NUL: No such file or directory foobar.pl 153: $left_frame->Label(text => "Perl Chat Client v$VERSION") 172: $right_frame->Label(text => 'Buddies') 200: print CONF "# You may edit this file with a text editor or\n +"; 852: # $request is the text of the request 853: # put text of reply into $outbuffer{$client} 1221: print CONF "# You may edit this file with a text editor or\ +n";

        $ perl -MTk -e " tkinit->Label( text => 1 );" unknown option "text" at C:/perl/site/5.14.1/lib/MSWin32-x86-multi-thr +ead/Tk/Widget.pm line 205. at -e line 1.
      Explanation of anonymous monk's post:

      grep -n "(text" test-tk2.pl 153: $left_frame->Label(text => "Perl Chat Client v$VERSION") 172: $right_frame->Label(text => 'Buddies')
      This shows two places where you have used "text" instead of "-text".

      Adding the "-" should solve your problem.

      Update: Just noticed that roboticus beat me to the punch.

                   I hope life isn't a big joke, because I don't get it.
                         -SNL