$str1 eq $str2 causing problems

A

Ashish Gupta

need some help in perl please.

i am comparing two strings both of which are supposed to be equal, but
the if condition returns false.

i am pasting the debugger portion below:


DB<2> v
1052: $server_name =~ s/\s*//g;
1053: $p_server =~ s/\s*//g;
1054
1055==> if ($server_name eq $p_server){
1056: for ($i=0; $i < scalar(@login_password);
$i+=2){
1057: $login = $login_password[$i];
1058: $password =
$login_password[$i+1];
1059: $login =~ s/\s*//g;
1060: if ($login eq $p_user){
1061: chomp($password);
DB<2> x $server_name
0 'SYB_DBA61_TKD'
DB<3> x $p_server
0 'SYB_DBA61_TKD'
DB<4> s
dba_syb_lib::sfi_connection_info(dba_syb_lib.pm:1066):
1066: }
DB<4>


note that even though $server_name and $p_server seem to be equal,
the if condition returns false and we jump to the closing brace on line
1066.

thanks,
ashish
 
A

Ashish Gupta

Hi,

I was able to figure out the problem.

Actually, the debugger is not jumping to the closing } of the if stmt.

For some strange reason, it starts off a for loop with its closing } !

The } on line 1066 is for the for loop enclosed within the if.

The program was failing overall because of another bug within the for
loop. And my attention shifted to the if stmt because of the quirky way
the debugger starts a for loop.

Thanks,
Ashish
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top