Script that Nulls Contents of Files

Ok,

I'm stuck here with a plan to get what I need done completed.

I want to use perl to produce a document. lets say the document will be a pdf document.

Now, is there a way for me to put a tiny little code in that pdf document that can make the pdf file null itself if run on a non-unix machine, i.e windows?

i know this is a unique thing i'm asking here. but can someone please help me out here?

a summary of what i'm asking is this?

how to create a pdf (or any file), that contains a code. this code should be able to ping/contact an external website, and based on the response it gets back from the external server, it should decide to either leave the pdf file alone or null it?

makes sense?

  1. check what is the type of OS
  2. according to it do the required operation..

what more you want .. you have all clarity already ?

You can probably do what you want to do using JavaScript embedded in the PDF document. Lots of information available on the Internet.