#!./perl

# $Header: op.magic,v 3.0.1.1 89/11/11 05:00:07 lwall Locked $

$| = 1;		# command buffering

print "1..6\n";

eval '$ENV{"foo"} = "hi there";';	# check that ENV is inited inside eval
if (`echo <foo>` eq "hi there\n") {print "ok 1\n";} else {print "not ok 1\n";}
delete $ENV{'foo'};

unlink 'asdfghj';
$! = 0;
open(foo,'asdfghj');
if ($! == 214) {print "ok 2\n";} else {print "not ok 2\n";}
$! = 0;
unlink 'asdfghjklpoiuyt';
if ($! == 67788) {print "ok 3\n";} else {print "not ok 3\n";}

eval <<'END';

$SIG{"INT"} = "ok4"; kill "INT";
$SIG{"INT"} = "IGNORE"; kill "INT"; print "ok 5\n";

sub ok4 { print "ok 4\n" if pop(@_) eq "INT"; }
END

@val1 = @ENV{keys(%ENV)};	# can we slice ENV?
@val2 = values(%ENV);

print join(':',@val1) eq join(':',@val2) ? "ok 6\n" : "not ok 6\n";
