exitonwarn.pm 348 Bytes
Newer Older
Leigh B. Stoller's avatar
Leigh B. Stoller committed
1 2 3 4 5
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2006 University of Utah and the Flux Group.
# All rights reserved.
#
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
$warnings = 0;

$SIG{__WARN__} = sub { print STDERR $_[0];$warnings++; };

END {
    if ($warnings > 0) {
	print STDERR "$warnings warnings.\n";
        # This actually causes perl to complain and exit with 255
	exit(1);		
    }
}

1;