This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
a "replacement" for awk and sed
[perl5.git] / t / op.magic
CommitLineData
8d063cd8
LW
1#!./perl
2
3# $Header: op.magic,v 1.0 87/12/18 13:13:54 root Exp $
4
5print "1..4\n";
6
7$| = 1; # command buffering
8
9$ENV{'foo'} = 'hi there';
10if (`echo \$foo` eq "hi there\n") {print "ok 1\n";} else {print "not ok 1\n";}
11
12$! = 0;
13open(foo,'ajslkdfpqjsjfkslkjdflksd');
14if ($! == 2) {print "ok 2\n";} else {print "not ok 2\n";}
15
16$SIG{'INT'} = 'ok3';
17kill 2,$$;
18$SIG{'INT'} = 'IGNORE';
19kill 2,$$;
20print "ok 4\n";
21$SIG{'INT'} = 'DEFAULT';
22kill 2,$$;
23print "not ok\n";
24
25sub ok3 {
26 print "ok 3\n" if pop(@_) eq 'INT';
27}