Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (12)
As of 2016-10-26 17:14 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (344 votes). Check out past polls.