'or' is is a boolean shortcircuit operator and not really a postcondition, though the shorcircuit part makes it work like one, just like 'and' can work as an 'if' statement:
(!open(my $fh, $filename)) and die "Can't open $filename: $!\n";
Switching back to the main topic of conversation, the one thing in Python I occassionally really really want is a 'repeat..until' loop for cases where I want some code executed at least once but likely more.
no subject
Date: 2004-11-09 05:19 pm (UTC)(!open(my $fh, $filename)) and die "Can't open $filename: $!\n";
Switching back to the main topic of conversation, the one thing in Python I occassionally really really want is a 'repeat..until' loop for cases where I want some code executed at least once but likely more.