in reply to Re^3: 'open for read' fails as "no such file or directory" but file is there
in thread 'open for read' fails as "no such file or directory" but file is there
G'day Alex,
Hand-crafting your own die messages can provide a lot more information than that provided by autodie. In some cases, using die instead of autodie is entirely appropriate. However,
... or die "Unable to open $filename for read: $!";
provides no more information than
$ perl -e 'use autodie; open $fh, "<", "not_a_file"' Can't open 'not_a_file' for reading: 'No such file or directory' at -e + line 1
See my reply to the OP for more on this.
— Ken
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: 'open for read' fails as "no such file or directory" but file is there
by talexb (Chancellor) on Nov 02, 2016 at 21:09 UTC |