#!/usr/bin/env perl

use strict;
use warnings;

use Pod::PseudoPod::DOM;
use Pod::PseudoPod::DOM::App::ToLateX;
use File::Basename;

my @files = map
{
    my $file = $_;

    # LaTeX output goes to the current working directory,
    # not the source directory.
    my $outfile = fileparse( $file, qr{\..*} ) . '.tex';

    [ $file => $outfile ]
} @ARGV;

Pod::PseudoPod::DOM::App::ToLaTeX::process_files_with_output( @files );

exit;
