unless ( syswrite( $pc, $data ) == length $data ) { # ... } #### unless ( defined syswrite( $pc, $data ) ) { # ... }