Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: Need help with Algorithm::Permute and openssl

by wdef2 (Acolyte)
on Jan 17, 2008 at 23:21 UTC ( #662976=note: print w/ replies, xml ) Need Help??


in reply to Re: Need help with Algorithm::Permute and openssl
in thread Need help with Algorithm::Permute and openssl

'art' is reached every time but only if I comment out the system line. If I leave the system call in, 'art' appears to never be reached. That's the only reason this test is in there (to prove that point):

if ($perm eq "art"){ # If system command is run below, this test is never true. # So system command changes $perm is some way # WTF? print "found $perm \n"; die; }
As for what is happening to $perm to do this (unset, altered in some way) I have no idea - otherwise I would have said so.


Comment on Re^2: Need help with Algorithm::Permute and openssl
Download Code
Re^3: Need help with Algorithm::Permute and openssl
by ikegami (Pope) on Jan 17, 2008 at 23:25 UTC

    No, if anything, that test proves that "art" wasn't reached.

    You have a print just before that if. Do you see it printing "art"? And again, if it does get cleared or corrupted, what does that print print? What's the last thing it prints that isn't corrupted? You already have the debugging statements in place, tell us what they show!

      Thanks for your help but perhaps I need to be clearer. If I run that code as is (try it?), art never gets reached. $perm never equals "art", since if it did it would die and print "found art", which is does not. openssl never returns success either, so the system command never returns sucess, so that second die is not triggered either. So the program just keeps printing perms.

      BUT if, and only if, I comment out that system call to openssl, art is reached quite quickly, and "found art" gets printed. If I simply set $perm = "art" before the system command (overriding whatever Algorithm::Permute has set it to), openssl decrypts the test file fine. openssl returns success, the program dies and prints "Found passphrase "art"".

      From all of which I conclude that $perm should get passed to openssl fine, but that, for some reason, it doesn't take the passphrase string 'art' if that system line is left in.

      You see why I'm puzzled?

      Are things happening in other than the order they seem to be?

        So the program just keeps printing perms.

        For the third time, what perms does it print?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://662976]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2014-12-20 04:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (95 votes), past polls