Multiple choice technology

"Capable" =~ m/able/;

  1. True

  2. cap

  3. able

  4. compilation error

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

The regex match operator =~ in Perl returns true if the pattern matches the string. The pattern /able/ is found in "Capable", so the match succeeds and returns true (which evaluates to 1 in boolean context). Option B 'cap' is not the return value, option C 'able' is just the matched substring, and option D is incorrect because this is valid Perl syntax.