summaryrefslogtreecommitdiff
path: root/t/op.magic
blob: 7696803127847a7378c28173f626dfdb3678d265 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!./perl

# $Header: op.magic,v 1.0 87/12/18 13:13:54 root Exp $

print "1..4\n";

$| = 1;		# command buffering

$ENV{'foo'} = 'hi there';
if (`echo \$foo` eq "hi there\n") {print "ok 1\n";} else {print "not ok 1\n";}

$! = 0;
open(foo,'ajslkdfpqjsjfkslkjdflksd');
if ($! == 2) {print "ok 2\n";} else {print "not ok 2\n";}

$SIG{'INT'} = 'ok3';
kill 2,$$;
$SIG{'INT'} = 'IGNORE';
kill 2,$$;
print "ok 4\n";
$SIG{'INT'} = 'DEFAULT';
kill 2,$$;
print "not ok\n";

sub ok3 {
    print "ok 3\n" if pop(@_) eq 'INT';
}