Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

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 nobody stirs...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2018-06-23 10:51 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (125 votes). Check out past polls.