The number one rule of learning by example is,
Good Examples are Hard to Come By.
I would recommend (gently) that you learn perl first, via some other route, then try to fix
this program, because it appears to me that its flaws are several and serious, particularly
with regard to error checking.
I don't think it should ever let you get to that section 2 if $expected_signer is null; and
clearly a regex match - at least, the one given - is inappropriate for determining the validity
of the $signer.
I also think it should be bailing out (via
die, for example) whenever an error is
encountered, rather than setting an error message and continuing on with processing.
Also, if ".pgp" is a valid file suffix, it should make explicit allowance for it. Otherwise,
it should throw an error for any invalid file suffix.
If my estimation of the situation is inaccurate, perhaps you could post more of the code, or
provide a pointer to the program, if available.
jdporter
The 6th Rule of Perl Club is -- There is no Rule #6.