if (-r -w $file) { # File is readable and writeable ... }