Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

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

by wdef2 (Acolyte)
on Jan 18, 2008 at 00:45 UTC ( #662989=note: print w/ replies, xml ) Need Help??


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

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?


Comment on Re^4: Need help with Algorithm::Permute and openssl
Re^5: Need help with Algorithm::Permute and openssl
by ikegami (Pope) on Jan 18, 2008 at 00:47 UTC

    So the program just keeps printing perms.

    For the third time, what perms does it print?

      Hold everything!

      It turns out it DOES eventually find "art" if I just leave it running long enough, so I was going off half-cocked.

      What threw me was that it is taking so much longer than my non-module lisp-like version. It's taking 7,758 perms to get to 'art' (same number twice).

      But the module-free version started with 'a' and worked its way through alpabetically, thus getting to art very quickly. Without thinking, I was expecting Permute to get there even faster, but the man page says there's no guarantee about the order that the module produces perms.

      So I guess it's working as expected.

      My apologies, my bad.. Thanks for the responses.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2014-09-18 00:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (101 votes), past polls