Search⌘ K

Challenge: Make Variables

Practice declaring various Perl variables such as integer character boolean and float and output their values using print. Understand basic variable types essential for Perl programming.

We'll cover the following...

Problem Statement

  • Declare an int type variable and name it intNumber and assign it a value of 1000.
  • Declare a char type variable and name it charName and assign it a value of N.
  • Declare a boolean type variable and name it boolAccept and assign it a value of 1.
  • Declare a float type variable and name it floatNum and assign it a value of 10.292.

Now output these values on the console using the print function in Perl. The values should be separated by a comma.

Output

1000, N, 1, 10.292

Before jumping onto the solution, give it a try first:

Perl
# Write your code below