This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perlapi: Fix grammar
[perl5.git] / t / lib / warnings / mg
CommitLineData
599cee73
PM
1 mg.c AOK
2
3 No such signal: SIG%s
4 $SIG{FRED} = sub {}
5
d8940893 6 Setting $/ to a reference to zero as a form of slurp is deprecated, treating as undef. This will be fatal in Perl 5.28
61666285 7
599cee73
PM
8 SIG%s handler \"%s\" not defined.
9 $SIG{"INT"} = "ok3"; kill "INT",$$;
10
599cee73
PM
11__END__
12# mg.c
4438c4b7 13use warnings 'signal' ;
599cee73
PM
14$SIG{FRED} = sub {};
15EXPECT
16No such signal: SIGFRED at - line 3.
17########
18# mg.c
4438c4b7 19no warnings 'signal' ;
0453d815
PM
20$SIG{FRED} = sub {};
21EXPECT
22
23########
61666285
FC
24-w
25# warnable code, warnings enabled via command line switch
26$/ = \0;
27EXPECT
d8940893 28Setting $/ to a reference to zero as a form of slurp is deprecated, treating as undef. This will be fatal in Perl 5.28 at - line 3.
61666285
FC
29########
30-w
31# warnable code, warnings enabled via command line switch
32$/ = \-1;
33EXPECT
d8940893 34Setting $/ to a reference to a negative integer as a form of slurp is deprecated, treating as undef. This will be fatal in Perl 5.28 at - line 3.
61666285 35########
ddc3d23f
FC
36$/ = \-1;
37no warnings 'deprecated';
38$/ = \-1;
39EXPECT
d8940893 40Setting $/ to a reference to a negative integer as a form of slurp is deprecated, treating as undef. This will be fatal in Perl 5.28 at - line 1.
ddc3d23f 41########
0453d815 42# mg.c
4438c4b7 43use warnings 'signal' ;
7b903762 44if ($^O eq 'MSWin32' || $^O eq 'NetWare' || $^O eq 'VMS') {
3eeba6fb 45 print "SKIPPED\n# $^O, can't kill() to raise()\n"; exit;
dfe13c55 46}
d008e5eb 47$|=1;
599cee73
PM
48$SIG{"INT"} = "fred"; kill "INT",$$;
49EXPECT
50SIGINT handler "fred" not defined.
0453d815
PM
51########
52# mg.c
4438c4b7 53no warnings 'signal' ;
7b903762 54if ($^O eq 'MSWin32' || $^O eq 'NetWare' || $^O eq 'VMS') {
e69a2255 55 print "SKIPPED\n# $^O, can't kill() to raise()\n"; exit;
0453d815
PM
56}
57$|=1;
58$SIG{"INT"} = "fred"; kill "INT",$$;
59EXPECT
60
b6f8df71
RGS
61########
62# mg.c
07c325bb
FC
63use warnings 'signal' ;
64if ($^O eq 'MSWin32' || $^O eq 'NetWare' || $^O eq 'VMS') {
65 print "SKIPPED\n# $^O, can't kill() to raise()\n"; exit;
66}
67$|=1;
68$SIG{__WARN__} = sub { warn shift =~ s/\0/\\0/rugs };
69$SIG{"INT"} = "fr\0d"; kill "INT",$$;
70EXPECT
71SIGINT handler "fr\0d" not defined.
72########
73# mg.c
74use warnings 'signal' ;
75use open ":std", ":utf8";
76use utf8;
77if ($^O eq 'MSWin32' || $^O eq 'NetWare' || $^O eq 'VMS') {
78 print "SKIPPED\n# $^O, can't kill() to raise()\n"; exit;
79}
80$|=1;
81$SIG{"INT"} = "프레드"; kill "INT",$$;
82EXPECT
83SIGINT handler "프레드" not defined.
84########
85# mg.c
b6f8df71 86use warnings 'uninitialized';
0e7ca5c9 87'foo' =~ /(foo)/;
9f621bb0 88oct $3;
b6f8df71 89EXPECT
9f621bb0 90Use of uninitialized value $3 in oct at - line 4.
0e7ca5c9
RGS
91########
92# mg.c
93use warnings 'uninitialized';
9f621bb0 94oct $3;
0e7ca5c9 95EXPECT
9f621bb0 96Use of uninitialized value $3 in oct at - line 3.
9ae3433d
RGS
97########
98# mg.c
99use warnings 'uninitialized';
100$ENV{FOO} = undef; # should not warn
101EXPECT
d5b4785c
DIM
102########
103${^ENCODING} = 42;
104{ local ${^ENCODING}; }
105${^ENCODING} = undef;
106{ local ${^ENCODING} = 37; }
107no warnings 'deprecated';
108${^ENCODING} = 42;
109{ local ${^ENCODING}; }
110${^ENCODING} = undef;
111{ local ${^ENCODING} = 37; }
112EXPECT
ac641426
A
113${^ENCODING} is no longer supported. Its use will be fatal in Perl 5.28 at - line 1.
114${^ENCODING} is no longer supported. Its use will be fatal in Perl 5.28 at - line 4.