Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re^2: Array of TK::Checkbuttons not acting appropriately

by mikasue (Friar)
on Oct 02, 2006 at 02:31 UTC ( #575830=note: print w/replies, xml ) Need Help??

in reply to Re: Array of TK::Checkbuttons not acting appropriately
in thread Array of TK::Checkbuttons not acting appropriately

This is the line that is erroring

    if ($checkboxvalue[$t] == 1)

This is the error

Use of uninitialized value in numeric eq (==) at BPP/ line 148.

I declare @checkboxvalue = () as such.

Should I do this also $checkboxvalue$t = 0; ?
I dont' understand why it is "uninitialized".

It seems that when I click the checkbox the onValue is not being set. So below is my declaration of the Checkbutton

$checkbox[$t] = $bill_table->Checkbutton(-variable=>\$checkboxvalu +e[$t]);

Perhaps -variable is not what I should use. I'm going to read more on the Checkbutton options

Replies are listed 'Best First'.
Re^3: Array of TK::Checkbuttons not acting appropriately
by GrandFather (Sage) on Oct 02, 2006 at 02:50 UTC

    I suggest you converge your problem code toward the sample I gave. If your problem remains at the end of that process, post the code and we will help further.

    Your immediate problem is likely to be that you are indexing an element that wasn't present in the array, so it is being created for you and set to undef. It is not clear from your code where $t may be set to anything other than 0, but it seems likely in your "real" code that it is.

    Again I suggest that you reproduce the problem in a small sample application (see my sample as a guide) that we can run and check.

    DWIM is Perl's answer to Gödel

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://575830]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2017-12-17 12:19 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (464 votes). Check out past polls.