mkdir "$dir", 0777 || die "Could not mkdir \"$dir\": $!\n";
Here is a demonstration of why this is wrong:
my $dir= "source"; # A directory that I know exists.
warn "Using or...\n";
mkdir "$dir", 0777 or die "Could not mkdir \"$dir\": $!\n";
warn "Using ||...\n";
mkdir "$dir", 0777 || die "Could not mkdir \"$dir\": $!\n";
warn "Done.\n";
This produces the following output:
E:\etm\Work>perl -w mkdir.pl
Using or...
Could not mkdir "source": File exists
Using ||...
Done.
Note that -w was silent as well, so I'm not sure when it will warn me of a precedence problem (I'm using Perl 5.6.0).
-
tye
(but my friends call me "Tye") |