in reply to using online translation engines with perl
Regarding part of your your question "I'm looking for a way to make the failure of mkdir more informative for the case that the directory already exists. I keep the mkdir line so that it will work the first time it is used. Every subsequent time, it fails, and $! is stone silent.", I'd suggest creating a function that checks whether the directory exists before creating it, something like (untested):
sub createDir { my $dirName = shift; if (-e $dirName) { if (-d $dirName) { return "Directory $dirName already exists!"; } else { return "Can't create $dirName because there's a file in th +e way!"; } } mkdir $dirName or return $!; }
...roboticus
When your only tool is a hammer, all problems look like your thumb.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: using online translation engines with perl
by afoken (Chancellor) on Nov 08, 2018 at 20:38 UTC | |
by Aldebaran (Curate) on Nov 22, 2018 at 06:56 UTC | |
by hippo (Archbishop) on Nov 22, 2018 at 09:21 UTC | |
by Aldebaran (Curate) on Nov 26, 2018 at 07:34 UTC | |
by hippo (Archbishop) on Nov 26, 2018 at 13:53 UTC | |
| |
by hippo (Archbishop) on Nov 26, 2018 at 10:06 UTC | |
|
Re^2: using online translation engines with perl
by Aldebaran (Curate) on Nov 07, 2018 at 00:19 UTC |