Hello all, I've got a random issue, that I'm having a hell of a time tracking down and am hoping someone can help or give a suggestion. The MListbox seems to work fine till it will randomly stop displaying results and I get the following error. Can't use string ("") as a subroutine ref while "strict refs" in use at /usr/lib/perl5/vendor_perl/5.8.8/Tk/MListbox.pm line 700. I've checked my returned results and nothing changes or is strange. Here is the section of code that is having issues. UPDATE: Upon further looking, a variable in the MListbox.pm becomes undef. Which I'm not sure how that's happening. Maybe someone who understands it more than I will know? The second section of code is taken from MListbox.pm. $code becomes undef.

my $searchRes = $top->DialogBox(-title => 'Search Results', -buttons => ['OK', 'Cancel'],) +; my @dispRes = qw(ID FirstName LastName); my $ml = $searchRes->Scrolled( qw/MListbox -selectmode single -scrollbars oe -font sm +all / )->pack(-expand => 1, -fill => 'both'); foreach my $colHdrs (@dispRes){ $ml->columnInsert('end',-text=>$colHdrs); } foreach (@dispRes){ push @row, $hash{$_}; } $ml->insert('end', \@row); $ml->see('end'); <-- Error get's thrown here print Dumper($ml->getRow('end')); $ml->update; my $answer = $searchRes->Show();
sub _selectionUpdate { my ($w, $code, $l, @args) = @_; ; if (@args) { foreach (@{$w->{'_columns'}}) { &$code($_->Subwidget("listbox"), @args); } } else { &$code($w->{'_columns'}->[0]->Subwidget("listbox")); } }

In reply to TK MListbox random issue by lightspd

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.