if ($val eq '2') { print 'foo'; } #### if ($val == '2') { print 'foo'; } #### (Why do we have separate numeric and string comparisons? Because we don't have special variable types, and Perl needs to know whether to sort numerically (where 99 is less than 100) or alphabetically (where 100 comes before 99)