help re:[ic] TIPS AND TRICKS: Tree example

C.B. Currier interchange-users@interchange.redhat.com
Sat Mar 9 15:52:01 2002


Some of the code from the example does not seem to work:

store /cgi-bin/store/tree_build.html Safe: Can't call method "set_slice" on
an undefined value at (eval 698) line 39.

30    my $db = $Db{menu_tree};
31    $db->query('delete from menu_tree');
32    my @flds = qw/parent_fld child_fld name category/;
33    my $count++;
34    for(@levels) {
35        my $hash = $_;
36	for(sort keys %$hash) {
37            	my $rec = $hash->{$_};
38           	 my $code = shift @$rec;
39	$db->set_slice($code, \@flds, $rec);
40	    $count++;
41        }
42    }
43    return $count;