in reply to Puzzling warning "Use of unitialized value" in very simple code

I am not commenting on the reason why your code behaves as it does as that seems to be discovered already, but rather on the code itself, or more particularly, on what appears to be a very strange password policy.

I ran the following code against this subroutine:

foreach ('test_NO PASSWORD', 'test_PASSWORD', 'test_test', 'test', 'te +st_abc???????def') { print "$_: ", getPasswordStatus(split /_/), "\n"; }
and got the following result:
test_NO PASSWORD: empty test_PASSWORD: password test_test: login test: ok test_abc???????def: ok test_A gOoD PASsword: weak
<p So if I understand this password-policy it is:
  1. an empty password is OK
  2. a password with 7 consecutive question marks is OK
  3. all other passwords are weak or are unacceptable for other reasons.
Of all the hare-brained password policies I have ever seen, this must rank within the top 3!

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Replies are listed 'Best First'.
Re^2: Puzzling warning "Use of unitialized value" in very simple code
by Anonymous Monk on Aug 05, 2008 at 09:45 UTC

    Hey CountZero,

    Thanks for giving me a so high place in your ranking :D.

    Actually the password argument is the result of the cracking phase. It should have been given a better name, I admit but I'm not the author of this code.

    I hope this enlightens your mind :).

    Regards,
    -- Jeremie