If you have many attributes then consider map and grep
poj#!/usr/bin/perl use strict; use XML::Writer; my $writer = XML::Writer->new(); my %obj = ( Type => 'Information', Phone => 0, Email => '', ); my %attr = map { $_ => $obj{$_} } grep { length $obj{$_} } keys %obj; $writer->startTag("Contact",%attr);
In reply to Re^3: XML::Write challenges
by poj
in thread XML::Write challenges
by denzilhere
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |