My data is in two column table format, so I don't think POD will pull it off, but I'll give it a glance anyway. Does POD support pagebreaks?

Yeah, I would experiment with other POD::*, or a *2pdf utility. POD doesn't do pagebreaks (as far as I have ever read), but the PDF module/utility will give you a way to define the page dimensions.. so it should add pagebreaks.

No, sadly the user is not logged in. This isn't mod_perl, just straight CGI, so I could use the PID I suppose. hmm. Other than a cronjob, I have no idea how to automatically unlink the file, since the CGI creating the PDF will end presumably long before the PDF is completely downloaded.

I do this:

my $out = pod2pdf(@args); print "Content-Type: application/pdf\n"; print "Content-Disposition: attachment; filename=$username.tasks.pdf\n +\n"; unlink "./pod/$username.tasks.$$.pod"; binmode(STDOUT); return print $out;

Of course, YMMV depending on the module you use. I think I had hacked POD::Pdf to return the Pdf data instead of just writing it to the file. I don't recall. But, otherwise you could just read the file in and print it:

my $out; { local $/ = undef; open(PDF, "$file") or die "foo $!"; $out = <PDF>; close PDF; }

Or whatever fits your fancy.

Cheers,
KM


In reply to Re: Re: Re: Avoiding race conditions by KM
in thread Avoiding race conditions by swiftone

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.