Just another Perl shrine | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Hi Monks,
I've been having a bit of trouble with getting perl to act reliably following a logical OR statement in code. I want to perform multiple operations in case of a failure when opening a file for write, and so my choices would seem to be to call a subroutine or to set a flag indicating a failure. For example: open FILE, ">test.txt" || $failed_flag = 1; The above example will not compile, I've also tried with using a &subroutine instead of a direct assignment with no luck. It compiles, but the subroutine seems to never actually run...
--------- Brian In reply to Variable assignment after logical OR by rq-2102
|
|