in reply to Found a Perl hole
= is the assignment operator. == is a comparative operator. Are you getting the two confused? You shouldn't write if ( $this = $that ) { ... } if you're trying to compare $this to $that. If you're trying to assign $that to $this, and at the same time evaluate whether $this equates to truth, that's what you're accomplishing using the = operator inside an 'if' conditional.
Dave
|
---|