sub pedantic_syswrite { my $context=wantarray; if (defined ($context)) { if ($context) { # caller wants an array, which is (mostly) silly for write die "write doesn't return an array, silly!\n"; } else { # scalar context # no warning, because user should always check return value syswrite @_; } } else { # void context die "I'm not going to write if you don't check my return value\n"; } }