String Operators: the right and wrong ways to perform an equivalence check on a string: : String « String « Perl
- Perl
- String
- String
String Operators: the right and wrong ways to perform an equivalence check on a string:
# Wrong!!!
if ($string == "Hello")
{
# Do something...
}
# Right!
if ($string eq "Hello")
{
# Do something...
}
Related examples in the same category