--- AnyEvent/constants.pl.PL 2010/03/12 23:30:06 1.2 +++ AnyEvent/constants.pl.PL 2010/03/13 00:09:28 1.4 @@ -1,7 +1,11 @@ #! perl -open STDOUT, ">$ARGV[0]~" - or die "$ARGV[0]~: $!"; +# this file is unfortunately only executed at Makefile.PL time + +open my $fh, ">lib/AnyEvent/constants.pl" + or die "lib/AnyEvent/constants.pl: $_[0]\n"; + +my $oldstdout = select $fh; sub i($$) { print "sub $_[0] () { ", $_[1]*1, " }\n"; @@ -11,7 +15,6 @@ our $WIN32 = $^O =~ /mswin32/i; - i CYGWIN => $^O =~ /cygwin/i; i WIN32 => $WIN32; @@ -62,5 +65,9 @@ print "1;\n"; -close STDOUT; +close $fh; +select $oldstdout; + rename "$ARGV[0]~", $ARGV[0]; + +1