Multiple choice technology programming languages

Assume that $var has the value hello . What is the value of the following sting?qq(It’s time to say $var);

  1. It’s time to say $var

  2. It’s time to say hello

  3. None

  4. Both

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

The qq() operator in Perl creates a double-quoted string where variables are interpolated with their values. Since $var contains 'hello', the string becomes 'It's time to say hello' rather than literally displaying the variable name. Option A would only occur with single quotes or no interpolation.

AI explanation

In Perl, qq() is simply an alternate delimiter syntax for double-quoted strings, so it performs the same variable interpolation that regular double quotes do. Since $var holds hello, it gets substituted directly into the string, producing 'It's time to say hello'.