use warnings; use strict; BEGIN{ open OLDERR, '>&', \*STDERR or die "Couldn't save STDERR\n$!"; close STDERR; } INIT{ open STDERR, '>&', \*OLDERR or die "Couldn't retrieve STDERR\n$!"; } use constant PI => 3.14; use constant PI => 1000; print PI, "\n";