Multiple choice technology programming languages

$data = “Welcome Perl” =~ /(.*)/; print $data;

  1. 0

  2. 1

  3. Welcome

  4. Perl

  5. Welcome Perl

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

The =~ binding operator with m// returns a boolean: true (1) if match succeeds, false (empty string) if it fails. Here, /(.*)/ matches the entire string successfully, so the expression returns 1 (true), which is assigned to $data and printed.