2011年1月20日星期四

[PerlChina] My test case failed in this way

Run following code, tell me your result.
 
#!/usr/bin/perl
 
my $a= "nAnQpW9mVV0TWLgbLgriCu6Tp2f2ymI7HUZfJS";
my $b= "nAnQpW9mVV0TWLgbLgriCu6Tp2f2ymI7HUZfJS";
 
if($a != $b)
{
    print("not equal!\n");
}
else
{
    print("equal!\n");
}
 
if("$a" != "$b")
{
    print("not equal!\n");
}
else
{
    print("equal!\n");
}
 
if(qw/$a/ != qw/$b/)
{  
    print("not equal!\n");
}  
else
{  
    print("equal!\n");
}

没有评论: