• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 16. CGI and Perl > Perl Operators

Perl Operators

Perl operators, for the most part, are identical to those in JavaScript, with some notable exceptions. First, numeric and string comparison operators are different. This difference can be very frustrating after using JavaScript because it’s easy to forget and use the wrong one. For example, the following script shows the correct way to use numeric and string operators:

						$alpha="Apples"; 
$omega="Oranges"; 
if($alpha ne $omega) { #Uses a string comparison 
      print "They are different \n\n"; 
      } 


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint