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"));
}
}
-
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.