Mega Code Archive

 
Categories / Perl / Language Basics
 

Three-way-comparison becomes cmp

#!/usr/bin/perl # use warnings; print"Which came first, the chicken or the egg? "; print "chicken" cmp "egg", "\n"; print "Are dogs greater than cats? "; print "dog" gt "cat", "\n"; print "Is ^ less than + ? "; print "^" lt "+", "\n";