Mega Code Archive

 
Categories / Perl / Language Basics
 

Relational Operators and String Values

#Operator           Example                     Meaning #gt                 $str1 gt $str2              $str1 is greater than $str2 #ge                 $str1 ge $str2              $str1 is greater than or equal to $str2 #lt                 $str1 lt $str2              $str1 is less than $str2 #le                 $str1 le $str2              $str1 is less than or equal to $str2 $fruit1 = "pear"; $fruit2 = "peaR"; $result = $fruit1 gt $fruit2; print "$result\n"; $result = $fruit1 lt $fruit2; print "$result\n";