Pravesh Biyani wrote:

> Hello
>  Here is a very simple prblem which unfortunatly i am not able to solve.
> I want to compare a character to a variable and do accordingly. I am
> using an if loop for this!!
> 
> but it seems that even if the variable is not equal to that character,
> it is entering the loop.. i am not able to figure out the prblm!!
> 
> here is the code:
> 
> 
> for( my $j =0  ; $j < $line_number ; ++$j)
> {
> 
> if ( $rows[0][$j] = 'E' )
> {

you probably mean '==' instead of '='. if you have warning enable (which i 
think you should), Perl will warn you about that.

'==' is for numerical comparison. Again, if you have warning enable, Perl 
will warn you if it encounter something that doesn't look like a number. 
you probably want to use 'eq' instead.

david

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to