Scalars


A single piece of data either a number or a string is called a 'scalar' in Perl.

  1. Numbers - integers, real or floating-point
  2. Strings
  3. Scalar variables (use my)
  4. Common error messages
  5. Greeting with a name, Variable interpolation
  6. User Input
  7. chomp
  8. Numerical Operators
  9. String Operators
  10. String - Number conversion
  11. Conditional statements: if
  12. Syntax of if statement
  13. Comparison operators
  14. Compare values - examples
  15. undef, the initial value and defined
  16. Boolean expressions (logical operators)
  17. Boolean values: TRUE and FALSE
  18. Your Salary is in Danger - Short-Circuit
  19. Exercise: Rectangular
  20. Exercise: Rectangular prompt
  21. Exercise: Rectangular warn
  22. Exercise: Concatenation
  23. Exercises: Simple Calculator
  24. Solution: Rectangular
  25. Solution: Rectangular prompt
  26. Solution: Rectangular warn
  27. Solution: Concatenation
  28. Solution: Simple Calculator
  29. Solution: Simple Calculator (using eval)
  30. String functions (length, lc, uc, index)
  31. String functions (substr)
  32. Strings - Double quoted
  33. Strings - Single quoted
  34. Scope of variables
  35. Random numbers
  36. Here documents - double quotes
  37. Here documents - single quotes
  38. Exercise: Number Guessing game
  39. Solution: Number Guessing game