'ne' compares them as strings, '!=' as numbers.
Any non-numeric string evaluates to zero, numerically, hence '!=' would (nearly) always claim two strings were equal. | [reply] |
Perl has different operators for comparing strings and
for comparing numbers. ne is for strings, and
!= is for numbers. See perldoc perlop
on your favorite command line.
Christian Lemburg
Brainbench MVP for Perl
http://www.brainbench.com
| [reply] [d/l] [select] |
!= and = are designed around numbers. Your text was just that - text.
ne, eq and such are designed around text. So, when comparing numbers, use math symbols.
When using text, use words.
What does this little button do . .<Click>;
"USER HAS SIGNED OFF FOR THE DAY" | [reply] [d/l] |
I'm not sure your while condition does what you want.
You probably meant
while (($pw1 ne $pw2) || ($pw1 eq ""))
I'd probably make that
until ($pw1 && ($pw1 eq $pw2))
Just a bit clearer, and correct. | [reply] [d/l] [select] |