Um... if this is a cgi script that you are quoting from, it seems like it would make sense for the "PRINT THIS PAGE" link to point back to this same cgi script, with a specific parameter that means "send the printable data back to the client".
In other words, you shouldn't need to create a temporary file at all (and therefore would not need to worry about how to delete the temp file). Add one more behavior mode to the current script, which will extract the "printable" content of your source data file (just like you're doing now), and print that to STDOUT (i.e. back to the client browser) instead of to a temp file.
Decide on a cgi parameter that will activate this new mode, and put that (along with any other relevant params) into the href for the "PRINT" link, instead of a file name.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.