in reply to Re^2: Need help with node names for creating header line
in thread Need help with node names for creating header line

Without $_

for my $record ($root->children) { my @tmp=(); for my $col (@cols){ push @tmp,$record->first_child($col)->text; } push @data,[ @tmp ]; }
poj

Replies are listed 'Best First'.
Re^4: Need help with node names for creating header line
by poj (Abbot) on Dec 30, 2015 at 18:44 UTC

    Are some tags missing ?. If so you will need to decide how to deal with them.

    for my $record ($root->children) { my @tmp=(); for my $col (@cols){ if (defined $record->first_child($col)){ push @tmp,$record->first_child($col)->text; } else { push @tmp,'';; } } push @data,[ @tmp ]; }
    poj
Re^4: Need help with node names for creating header line
by vlturner (Sexton) on Dec 30, 2015 at 18:32 UTC
    Still getting this error perl CMDB_Sample.pl Can't call method "text" on an undefined value at CMDB_Sample.pl line 62.