buckskinjeans has asked for the wisdom of the Perl Monks concerning the following question:

I am attempting to install authentication pages on my site. I am trying to figure out why ,when run in debugger, I keep getting syntax error line 663 and line 664. Here are the two lines....

$encrypt_pass = crypt($FORM {'PASSWORD'},substr(rand(time),-2); $encrypt_verify = crypt($FORM {'VERIFY'},substr(rand(time),-2);

The error message says the syntax problem is near ");"

Any help solving this problem would be greatly appreciated.

Thanks

Ron

Edit by dws for readability

Replies are listed 'Best First'.
Re: code snippet problem
by sauoq (Abbot) on Sep 04, 2002 at 21:16 UTC

    Both lines are missing ending parentheses.

    -sauoq
    "My two cents aren't worth a dime.";
    
Re: code snippet problem
by sauoq (Abbot) on Sep 04, 2002 at 21:27 UTC
    After you find and familiarize yourself with an editor that shows matching parens, you might want to read the documentation on crypt() as well. You are picking your salt from 100 different values. (Those that are composed of digits.) A salt's character can be chosen from the set [./0-9a-zA-Z] which gives a possible 4096 different combinations. Limiting yourself to less than 3% of those is probably not a good idea.

    -sauoq
    "My two cents aren't worth a dime.";
    
      Thank you so much, and the I see what you mean with the encryption possibilities. As for this program, perhaps I need to go back to the books. Debugging a 900 line program may be biting off more then I should at this point. It came with a book on a cd.. The "companion web site " with updates, is now gone,,hmm,,well,,anyway,, I again thankyou and will continue to plug away at these bugs.

      Ron

Re: code snippet problem
by demerphq (Chancellor) on Sep 04, 2002 at 21:56 UTC
    Please dont put font size adjustments into your nodes. We use a strange mix of CSS and stuff here and your node just toasted the site layout (for me at least).

    crypt($FORM {'VERIFY'},substr(rand(time),-2); 1 2 3 3 2
    is an easy way to find out which paren youve missed (many editors will do this for you)

    Yves / DeMerphq
    ---
    Software Engineering is Programming when you can't. -- E. W. Dijkstra (RIP)

      Hey thanks for the help on the code and also the info regarding font tags on my posts. I do not know how to edit that original post and not sure I can now.