Multiple choice technology

$str = "ha" x 5; print $str;

  1. hahahahaha

  2. Compilation error

  3. haX5

  4. nothing

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

In Perl, the x operator repeats a string. The expression "ha" x 5 creates "hahahahaha" by repeating "ha" five times. This is a valid Perl string operation. Option B is incorrect because this is valid syntax, option C would require concatenation or different syntax, and option D is wrong because x is the repetition operator not a multiplication symbol.