Es wäre gut, wenn Du etwas genauer beschreibst was Du machen willst...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use strict;
use warnings;
use XML::Simple;
my $data = {
communities => [
{
name => 'perl-community.de',
url => 'http://www.perl-community.de',
},
{
name => 'otrs-community',
url => 'http://www.otrs.org',
},
],
};
my $xs = XML::Simple->new;
my $xml = $xs->XMLout( $data );
print $xml;
perl xml_simple.pl
<opt>
<communities name="perl-community.de" url="http://www.perl-community.de" />
<communities name="otrs-community" url="http://www.otrs.org" />
</opt>
Um in eine Datei zu schreiben, solltest Du Dir
perldoc -f open anschauen...