Multiple choice technology programming languages

  1. &complex_num();
  2. complex_num();

which is correct?

  1. 1 can only be called with predecleration of complex_num

  2. 1 and 2 are same

  3. 2 can only be called with predecleration of complex_num

  4. 1 is reference to a subroutine

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

In Perl, calling a subroutine without the ampersand sigil requires a pre-declaration (or prior definition) to let the compiler parse it properly, whereas using the ampersand allows calling it without such declarations. Therefore, the second syntax relies on pre-declaration, making this option correct.