diff --git a/lc1.pl b/lc1.pl index 190562a97dd65088e7d7232a1292a909c5cc6161..2e567aa80eabccbf71017d8317a677586f7ce598 100755 --- a/lc1.pl +++ b/lc1.pl @@ -1,5 +1,21 @@ #!/usr/bin/perl +=head1 NAME + + lc1.pl + +=head1 USAGE + + ./lc1.pl & + +=head1 DESCRIPTION + +Upon start, searches for old LaTeX to PDF conversion jobs and perfoms +them. Then the script monitors the current directory for new conversion +jobs and executes them. + +=cut + use strict; use Filesys::Notify::Simple; @@ -30,7 +46,7 @@ sub watch { my ($job, $tex_file)= ($1, $2); print __LINE__, " job=[$job] tex_file=[$tex_file]\n"; - pdf2latex ($job, $tex_file); + latex2pdf ($job, $tex_file); } elsif ($path =~ m#/var/www/html/dlbt/DLBTUploads/TeiConverter/lc1.pl$#) { @@ -73,12 +89,12 @@ sub check_old_jobs else { # print __LINE__, " job=[$job] tex_file=[$tex_file]\n"; - pdf2latex ($job, $tex_file); + latex2pdf ($job, $tex_file); } } } -sub pdf2latex +sub latex2pdf { my $jobname= shift; my $tex_file= shift; @@ -111,7 +127,7 @@ sub pdf2latex } print "converting: [", join (' ', @convert), "]\n"; - sleep (5); + sleep (5); # wait some time to avoid possible race conditions system (@convert); if (-d $media_dir) @@ -120,3 +136,10 @@ sub pdf2latex unlink ('media') } } + +__END__ + +=head1 AUTHOR + + Gerhard Gonter <ggonter@cpan.org> +