in reply to Unexpected file test (-f) result on Windows
isn't the same asopen FILE, ">testfile.log" || die "Unable to create file: $!";
oropen(FILE, ">testfile.log") || die "Unable to create file: $!";
In the first case, you will never, ever see that die. In the second and third cases, you will. Consult the Perl operator precedence table in perlop for details.open FILE, ">testfile.log" or die "Unable to create file: $!";
Further, you can save yourself a lot of confusion by using the three argument form of open. E.g.,
This allows you to pass around filenames in variables without polluting them with extraneous symbols.open(FILE, ">", $log) or die "$log: $!";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Unexpected file test (-f) result on Windows
by DaveH (Monk) on Sep 19, 2003 at 15:47 UTC | |
by dws (Chancellor) on Sep 19, 2003 at 17:22 UTC | |
by DaveH (Monk) on Sep 19, 2003 at 17:39 UTC |