Multiple choice technology programming languages

In perl ,if \$variable="10" then what will output of print 'this is \$variable'; ?

  1. this is $10
  2. this is $variable
  3. this is

  4. this is 10

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

In Perl, single quotes do NOT interpolate variables. The print statement uses single quotes, so \$variable is treated literally as the string '\$variable', not replaced with '10'. Double quotes would interpolate, giving 'this is 10'. This is a fundamental distinction between single and double quoted strings.