Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

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.

Replies are listed 'Best First'.
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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://662976]
LanX frowning!
[Corion]: Hi choroba, LanX!
[Corion]: LanX: Turn that frown upside down! ;)
[Eily]: hello people!
[choroba]: a bit early for harvest mite, isn't it?

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (8)
As of 2018-05-23 07:39 GMT
Find Nodes?
    Voting Booth?