Using Expect.pm 2 managge unreliable programs - 0 views
-
here is a working example. This script shows 2 ways, one is saving the key to a file and reading it back in, the other, just hard codes the file contents into a variable. I tried a few things to avoid a temp file, but no luck. There is a Content type for the write, but it dosn't seem to work for scalar....it still writes a file.
- ...4 more annotations...
-
looking at a post by Sisyphus on comp.lang.perl. misc, it seems that you CAN use the numeric keys, like you tried in your original post. He showed a neat trick ( which I will have to explore further) where he reblessed the key data, and it works.
-
This node How to Make Crypt::DSA use a your key to sign something got me thinking about how to extend Crypt::DSA's potential, to make public and private keys, for signing verification. The script below, will verify 2 ways, once with scalars inside the script, and once from files. The generated sig, is actually binary, so note the base64 encoding of it, for attachment to emails, etc. I must thank sisyphus for the trick of reblessing a hash back into an object. This is the critical part of the script, where the public and private keys are generated. The docs for Crypt::DSA don't show how to separate them,( and you wouldn't want to be distributing your private key in the public PEM file. :-)
-
Note: This isn't really a Perl thing, but I'm using it for Perl scripts and it's too handy not to share
-
Expect.pm Test Program One The following test program runs the unreliable program twenty times. If the unreliable program takes longer than five seconds, the attempt to run it is terminated and the test program continues.