Mega Code Archive

 
Categories / Perl / Data Type
 

The result when these two strings are compared depends on whether a string or integer comparison is being performed

$result = "123" < "45";  #the strings 123 and 45 are converted to integers, and 123 is compared to 45.  $result = "123" lt "45"; #123 is alphabetically compared to 45.