use File::Temp qw/tempfile/; my ($fh_1, $fn_1) = tempfile('cXXXX', SUFFIX=>'.cpp', UNLINK => 1); my ($fh_2, $fn_2) = tempfile('oXXXX', SUFFIX=>'.out', UNLINK => 1); print {$fh_1} "int main() {}\n"; close $fh_1; if( system("cc -o $fn_2 --std=c++11 -lpthread $fn_1") ) { warn "Unsupported compiler or missing library (must be C+11 compliant and have POSIX thread support)\n"; exit(0); # will be ignored by CPAN Testers as having unmet dependencies }