Challenge 3: Fix the Missing or die — Possible Solution ==================================================================== Given: open(my $fh, '<', 'does_not_exist.txt'); What happens when this runs against a genuinely missing file: open() fails silently — it returns a false value, but since nothing checks that return value, the script simply continues running with $fh left undefined (or otherwise unusable), producing no visible error at all; any later attempt to read from $fh either fails quietly too or triggers a separate, more confusing warning far away from the actual root cause. Corrected version: open(my $fh, '<', 'does_not_exist.txt') or die "Can't open does_not_exist.txt: $!"; WHY THIS WORKS AS AN ANSWER ------------------------------ The one-sentence explanation reuses this chapter's own warn-box almost exactly — "a script that fails to open a file... continues running anyway, silently doing nothing useful with an unopened filehandle," described there as "a genuinely common source of 'my script ran with no errors but produced no output' confusion." This challenge asks specifically to state that consequence rather than just avoid it. The fix reuses the exact or die "..."; idiom the chapter establishes as standard practice, first introduced with Chapter 5's own open(...) or die pattern and reused throughout every open() call in this chapter's own examples. Adding it here means a missing file now produces an immediate, specific, human-readable error — "Can't open does_not_exist.txt: No such file or directory" (via the $! special variable, also reused from Chapter 5) — right at the point of failure, instead of the silent, hard-to-diagnose non-failure the original version produced.