Just another Perl shrine | |
PerlMonks |
Re: Code hanging with Crypt OpenPGPby kennethk (Abbot) |
on Nov 11, 2013 at 21:45 UTC ( [id://1062059]=note: print w/replies, xml ) | Need Help?? |
One issue with your posted code, though I would be surprised if this is your issue, is that you are only pulling in one line of your plaintext - to pull a full file into a scalar, you should either set binmode or slurp (my $plaintext = do{local $/;<INFILE>}). Maybe you're encoding a null string and thus your output is much shorter than you expect?
It's possible, though seems unlikely, that you've got some strange characters in your opens (your posted code shouldn't suffer from that issue). 3-argument open will handle any escapes that that need handling. Swapping to Indirect Filehandles, that would be:
Also note "\.[^.]*" doesn't mean what you likely thought, though it still works for your purposes for the given code. Lastly, if you have your literal key pasted in the block for $ring, your use of qq delimiters might result in some weird interpolation, though that would likely have gotten caught by strict. Hope some of this helps... Update: Fixed typo, as per below. #11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
In Section
Seekers of Perl Wisdom
|
|