Hi I am trying to do a basic IRC chat client in Perl using TK and IO::Stream and a few other modules that are not important to the problem. So basically whats going on here is the response from the server is suppose to be inserted into the listbox or chat window if you will but its not working for some weird reason heres parts of the code.
# Fork it into two process's my $kidpid; die "Cant Fork: $!" unless defined($kidpid = fork()); if ($kidpid) { while (defined ( my $line = <$sock> ) ){ chomp($line); $line =~ s/(\x0a|\x0d)//g; # Display response from server &show($line); print "<< $line\n";
The &show($line); Is what runs the sub routine to enter the response from the server into the list box heres that routine.
sub show { my $line = $_; print "Testing if this is even working!!!\n\n"; print "<< $line\n"; $scrolledText -> insert('end',"<< $line"); # Insert the text in +to the Listbox $scrolledText }
Now the print statement that says "Testing if this is even working!!!" Is printing so the routine is being called. But the Text is not inserting into the ListBox.Also the Print "<< $line\n"; is only printing out the << part and not the response from the server. If anyone knows why this is happening it would be appreciated a lot thank you.

In reply to Perl - TK - Listbox insertion problem by k0rn

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.