first of all remove that '=' sign and use '==' . again to compare the strings use 'eq'.
--- pravesh biyaNI <[EMAIL PROTECTED]> 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' ) > { > print " iam here \n"; > print " the value of the first element is > $rows[0][$j] and the value of > the sequence number is $rows[5][$j] \n"; > if( $packet_number != $rows[5][$j]) > { > print "i am also here in $ch_count \n"; > ++($loss); > } > ++ $packet_number ; > } > else > { > print " the value of count is $j \n"; > } > } > > > > -- > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > __________________________________________________ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]