In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] (Deborah) writes:
>In the same line as my last question.... once I tried to understand how
>Perl was interpreting string comparisons, I started experimenting with
>different strings.
>
>What is Perl doing here? Why doesn't it use the "if" statement as a
>condition? It reassigns the variable value instead of using it as a
>conditional statement in the following code:
Always enable warnings when developing code:
$ perl -w
$password=bill;
Unquoted string "bill" may clash with future reserved word at - line 1.
if ($password = 'howard') {
print "'$password' is a valid password.\n";
}else {
print "'$password' is not valid.\n";
}
^D
Found = in conditional, should be == at - line 2.
--
Peter Scott
http://www.perldebugged.com
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]