Variables
Data Types

  • Values of any type may be stored in a perl variable
      $myVar = 'c';             # Character
      $myVar = "Hello World!";  # String
      $myVar = 42;              # Integer
      $myVar = 3.14159;         # Float
      

  • Conversion from one type to another happens automatically, eg:

      From To Conversion
      "42" 42 String to integer
      42 "42" Integer to string
      "3.14159" 3.14159 String to float
      3.14159 "3.14159" Float to string
      "c" 'c' String to char
      'c' "c" Char to string