#!/usr/bin/perl
#===============================================================================
#
#         FILE: pod6xml
#
#  DESCRIPTION:  save Perl pod to xml
#       AUTHOR:  Aliaksandr P. Zahatski ,  <zahatski@gmail.com>
#===============================================================================
#$Id: dump.pl 1855 2008-06-05 10:35:06Z zag $
use strict;
use warnings;
use Data::Dumper;
use Test::More;
use Getopt::Long;
use Pod::Usage;
use Encode qw(encode decode is_utf8);
use Perl6::Pod::To;
use Perl6::Pod::To::XML;
my ( $help, $man, $partner_id );
my %opt =
  ( help => \$help, man => \$man, pid => \$partner_id );    #meta=>\$meta,);
GetOptions( \%opt, 'help|?', 'man', 'c=s', 'pid|s=s' )
  or pod2usage(2);
pod2usage(1) if $help;
pod2usage( -exitstatus => 0, -verbose => 2 ) if $man;

my $infile = shift;
my $in_fd;
if ($infile) {
    $in_fd = new IO::File:: "< $infile" or die "$infile: $!";
}
else {
    $in_fd = \*STDIN;
}

my $p = Perl6::Pod::To::to_abstract( 'Perl6::Pod::To::XML', \*STDOUT );
$p->parse($in_fd);

exit;

=head1 NAME

  pod6xml  - convert Perl pod to XML

=head1 SYNOPSIS

  pod6xml < somefile.pod > somefile.xml
  pod6xml somefile.pod  > somefile.xml


   options:

    -help  - print help message
    -man   - print man page

=head1 OPTIONS

=over 8

=item B<-help>

Print a brief help message and exits

=item B<-man>

Prints manual page and exits

=back

=head1 DESCRIPTION

  B<pod6xml>  - command line tool for export partner from partner_db

=head1 EXAMPLE

  pod6xml < somefile.pod > somefile.xml


=head1 AUTHOR

Zahatski Aliaksandr, E<lt>zahatski@gmail.comE<gt>

=head1 COPYRIGHT AND LICENSE

Copyright 2009 by Zahatski Aliaksandr

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself. 

=cut

