Apache-Admin-Config
view release on metacpan or search on metacpan
lib/Apache/Admin/Config.pm view on Meta::CPAN
foreach(shift->comment)
{
$_->delete;
}
}
sub delete_all_comments
{
foreach($_[0]->section)
{
delete_all_comments($_);
}
delete_comments($_[0]);
}
delete_all_comments($conf);
#
# Transform configuration file into XML format
#
my $c = new Apache::Admin::Config "/path/to/file", -indent => 2
or die $Apache::Admin::Config::ERROR;
$c->set_write_directive(sub {
my($self, $name, $value) = @_;
return($self->indent.qq(<directive name="$name" value="$value />\n));
});
$c->set_write_section(sub {
my($self, $name, $value) = @_;
return($self->indent.qq(<section name="$name" value="$value">\n));
});
$c->set_write_section_closing(sub {
my($self, $name) = @_;
return($self->indent."</section>\n");
});
$c->set_write_comment(sub {
my($self, $value) = @_;
$value =~ s/\n//g;
return($self->indent."<!-- $value -->");
});
print $c->dump_reformat();
=head1 AUTHOR
Olivier Poitrey E<lt>rs@rhapsodyk.netE<gt>
=head1 AVAILABILITY
The official FTP location is:
B<ftp://ftp.rhapsodyk.net/pub/devel/perl/Apache-Admin-Config-current.tar.gz>
Also available on CPAN.
anonymous CVS repository:
CVS_RSH=ssh cvs -d anonymous@cvs.rhapsodyk.net:/devel co Apache-Admin-Config
(supply an empty string as password)
CVS repository on the web:
http://www.rhapsodyk.net/cgi-bin/cvsweb/Apache-Admin-Config/
=head1 BUGS
Please send bug-reports to aac@list.rhapsodyk.net. You can subscribe to the list
by sending an empty mail to aac-subscribe@list.rhapsodyk.net.
=head1 LICENCE
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
=head1 COPYRIGHT
Copyright (C) 2001 - Olivier Poitrey
( run in 1.994 second using v1.01-cache-2.11-cpan-39bf76dae61 )