#!/usr/bin/perl
use XML::Simple;
my %commands = (command => [
{name => 'df', description => 'Reports file system disk space usage.'},
{name => 'ls', description => 'List directory contents.'},
{name => 'ps', description => 'Report a snapshot of current processes.'}]
);
my $xmlObj = XML::Simple->new(RootName => 'commands');
print $xmlObj->XMLout(\%commands, noattr => 1, OutputFile =>'commands.xml', xmldecl =>'<?xml version="1.0">');
use XML::Simple;
my %commands = (command => [
{name => 'df', description => 'Reports file system disk space usage.'},
{name => 'ls', description => 'List directory contents.'},
{name => 'ps', description => 'Report a snapshot of current processes.'}]
);
my $xmlObj = XML::Simple->new(RootName => 'commands');
print $xmlObj->XMLout(\%commands, noattr => 1, OutputFile =>'commands.xml', xmldecl =>'<?xml version="1.0">');
No comments :
Post a Comment