I can't figure out how to check if node contains value with XML::Simple module in Perl... Here is the my code:
my $parser = XML::Simple->new;
my $url = 'http://some/xml.aspx';
my $content = get $url or die "Unable to get $url\n";
my $data = $parser->XMLin($content);
print "Content-Type: text/html; charset=utf-8\n\n";
foreach my $property (@{$data->{propertyList}}) {
if ($property->{'boiler'}) {
print Dumper($property->{'boiler'});
}
}
Some of Boiler
nodes can be empty and the output looks like that:
$VAR1 = "\x{5e9}\x{5de}\x{5e9}";
$VAR1 = "\x{5e9}\x{5de}\x{5e9}";
$VAR1 = "\x{5e9}\x{5de}\x{5e9}";
$VAR1 = {};
$VAR1 = "\x{5e9}\x{5de}\x{5e9}";
$VAR1 = {};
$VAR1 = "\x{5e9}\x{5de}\x{5e9}";
$VAR1 = "\x{5e9}\x{5de}\x{5e9}";
$VAR1 = "\x{5e9}\x{5de}\x{5e9}";
$VAR1 = "\x{5e9}\x{5de}\x{5e9}";
$VAR1 = {};
$VAR1 = "\x{5e9}\x{5de}\x{5e9}";
$VAR1 = {};
$VAR1 = "\x{5e9}\x{5de}\x{5e9}";
The fourth $VAR1
is empty but how can I check it in code??
Thank you in advance