Multiple choice technology programming languages

What is the outcome of the scenario : open(FH, ">c:\temp\notes.txt") ?

  1. Opens a file notes.txt

  2. fails to create a file and displays error

  3. fails to open a file but doesn't display error

  4. Opens a file but not notes.txt

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

In Perl, the backslash in "c:\temp\notes.txt" is an escape character. \t becomes a tab character, \n becomes newline. So the actual filename interpreted is "c:empotes.txt" - a garbled path, not "c:\temp\notes.txt". The file will be created with this incorrect name if permissions allow.