W
woodenbicycle
Help! I am just a perl tinkerer who doesn't know much about data
strctures. I am having a problem with a little pet project of mine.
Please take a look and help me if you have time.
I upgraded from 5.6.1 to 5.8.4 and now some of my old code now seems to
be broken. I have been banging my head over this over the weekend and I
think the problem has to do with the way I am deleting an item from my
Hash of Hashes.
I have the code segment below. "HoH" is the Hash of Hashes. "key_list"
is a list of the keys in HoH. "selected" is the index number of the
item I wish to delete from the HoH via the key_list.
0-50: ### Obtain $selected by a Perl/Tk scrolled listbox and button
51: print "running...\n";
52: my $key = $key_list[$selected];
53: print "delete item# $key\n";
54: delete $HoH{$key};
55: $key_list[$selected] = '0';
56+: ### Build new key_list with a simple loop
I get the following to the console when code is run:
running...
delete list# ARRAY(0x85089a8)
Use of reference "ARRAY(0x85089a8)" as array index at testcase.pl line
52.
Use of uninitialized value in concatenation (.) or string at
testcase.pl line 53.
delete item#
Use of uninitialized value in delete at testcase.pl line 54.
Use of reference "ARRAY(0x85089a8)" as array index at testcase.pl line
55.
Out of memory!
Callback called exit.
Callback called exit.
Segmentation fault
This code seems to work fine under 5.6.1 but does not work under 5.8.4.
I thank you now for your help!
Pepper
strctures. I am having a problem with a little pet project of mine.
Please take a look and help me if you have time.
I upgraded from 5.6.1 to 5.8.4 and now some of my old code now seems to
be broken. I have been banging my head over this over the weekend and I
think the problem has to do with the way I am deleting an item from my
Hash of Hashes.
I have the code segment below. "HoH" is the Hash of Hashes. "key_list"
is a list of the keys in HoH. "selected" is the index number of the
item I wish to delete from the HoH via the key_list.
0-50: ### Obtain $selected by a Perl/Tk scrolled listbox and button
51: print "running...\n";
52: my $key = $key_list[$selected];
53: print "delete item# $key\n";
54: delete $HoH{$key};
55: $key_list[$selected] = '0';
56+: ### Build new key_list with a simple loop
I get the following to the console when code is run:
running...
delete list# ARRAY(0x85089a8)
Use of reference "ARRAY(0x85089a8)" as array index at testcase.pl line
52.
Use of uninitialized value in concatenation (.) or string at
testcase.pl line 53.
delete item#
Use of uninitialized value in delete at testcase.pl line 54.
Use of reference "ARRAY(0x85089a8)" as array index at testcase.pl line
55.
Out of memory!
Callback called exit.
Callback called exit.
Segmentation fault
This code seems to work fine under 5.6.1 but does not work under 5.8.4.
I thank you now for your help!
Pepper