Macros to the rescue Try using macros in C: #include #define Chksys0(s) assert( (s) == 0 ) #define Chksys1(s) assert( (s) >= 0 ) And write Chksys0( unlink("filename") ); Chksys0( bytes = read( fd, buffer, 100 ) ); Chksys1( fd = open( FILENAME, O_RDWR|O_EXCL|O_CREAT, 0666 ) ); Chksys1( time( &t ) ); In Perl, return value is usually true/false in a logical way. (Macro idea based on excerpt from "Practical Unix & Internet Security, 3rd Edition", Garfinkel/Spafford/Schwartz. Go buy this book.)