Example 6-3. examples/files/open_missing_file.pl
#!/usr/bin/perl use strict; use warnings; if (open my $fh, '<', "nosuch") { # should do here something } else { warn $!; }
The error message we get: No such file or directory at examples/files/open_missing_file.pl line 7.