in reply to Variable assignment after logical OR
open(FILE, ">test.txt") || $failed_flag = 1;
It is often recommended these days to use the three-argument form of open with lexical filehandles, like this.
open my $testFH, '>', 'test.txt' or $failed_flag = 1;
Cheers,
JohnGG
Update: I really must learn to type faster :(
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Variable assignment after logical OR
by rq-2102 (Acolyte) on Oct 02, 2007 at 19:36 UTC | |
by ikegami (Patriarch) on Oct 02, 2007 at 20:47 UTC |