Multiple choice technology programming languages

Which command should be used to close the filehandle KAREN?

  1. close KAREN "sw";

  2. KAREN close;

  3. close KAREN;

  4. close &KAREN

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

The correct Perl syntax to close a filehandle is close KAREN; - just the close keyword followed by the filehandle name. Options A incorrectly includes a filename argument, B has wrong word order, and D incorrectly uses & prefix which is for subroutine calls.