$amode = do { if ($flag & O_RDONLY) { "r" } # XXX: isn't this 0? elsif ($flag & O_WRONLY) { ($flag & O_APPEND) ? "a" : "w" } elsif ($flag & O_RDWR) { if ($flag & O_CREAT) { "w+" } else { ($flag & O_APPEND) ? "a+" : "r+" } } };
Forward to Switch with for via && and ||
Back to Learn to Switch with for
Up to index
Copyright © 1998, Tom Christiansen
All rights reserved.