Multiple choice technology programming languages

How can you include code from another file in your program?

  1. With the #include preprocessor command

  2. Adding the file’s directory to @INC and then passing the filename to require.

  3. Both A & B

  4. None of the above

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

Perl offers multiple ways to include code from other files. The #include preprocessor command works like C-style includes, and adding the file's directory to @INC then using require is the dynamic Perl approach. Both methods are valid for code inclusion in different contexts.