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
1   mg.c  AOK
2
3   No such signal: SIG%s
4     $SIG{FRED} = sub {}
5
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
7
8   SIG%s handler \"%s\" not defined.
9     $SIG{"INT"} = "ok3"; kill "INT",$$;
10
11 __END__
12 # mg.c
13 use warnings 'signal' ;
14 $SIG{FRED} = sub {};
15 EXPECT
16 No such signal: SIGFRED at - line 3.
17 ########
18 # mg.c
19 no warnings 'signal' ;
20 $SIG{FRED} = sub {};
21 EXPECT
22
23 ########
24 -w
25 # warnable code, warnings enabled via command line switch
26 $/ = \0;
27 EXPECT
28 Setting $/ 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.
29 ########
30 -w
31 # warnable code, warnings enabled via command line switch
32 $/ = \-1;
33 EXPECT
34 Setting $/ 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.
35 ########
36 $/ = \-1;
37 no warnings 'deprecated';
38 $/ = \-1;
39 EXPECT
40 Setting $/ 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.
41 ########
42 # mg.c
43 use warnings 'signal' ;
44 if ($^O eq 'MSWin32' || $^O eq 'NetWare' || $^O eq 'VMS') {
45     print "SKIPPED\n# $^O, can't kill() to raise()\n"; exit;
46 }
47 $|=1;
48 $SIG{"INT"} = "fred"; kill "INT",$$;
49 EXPECT
50 SIGINT handler "fred" not defined.
51 ########
52 # mg.c
53 no warnings 'signal' ;
54 if ($^O eq 'MSWin32' || $^O eq 'NetWare' || $^O eq 'VMS') {
55     print "SKIPPED\n# $^O, can't kill() to raise()\n"; exit;
56 }
57 $|=1;
58 $SIG{"INT"} = "fred"; kill "INT",$$;
59 EXPECT
60
61 ########
62 # mg.c
63 use warnings 'signal' ;
64 if ($^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",$$;
70 EXPECT
71 SIGINT handler "fr\0d" not defined.
72 ########
73 # mg.c
74 use warnings 'signal' ;
75 use open ":std", ":utf8";
76 use utf8;
77 if ($^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",$$;
82 EXPECT
83 SIGINT handler "프레드" not defined.
84 ########
85 # mg.c
86 use warnings 'uninitialized';
87 'foo' =~ /(foo)/;
88 oct $3;
89 EXPECT
90 Use of uninitialized value $3 in oct at - line 4.
91 ########
92 # mg.c
93 use warnings 'uninitialized';
94 oct $3;
95 EXPECT
96 Use of uninitialized value $3 in oct at - line 3.
97 ########
98 # mg.c
99 use warnings 'uninitialized';
100 $ENV{FOO} = undef; # should not warn
101 EXPECT
102 ########
103 ${^ENCODING} = 42;
104 { local ${^ENCODING}; }
105 ${^ENCODING} = undef;
106 { local ${^ENCODING} = 37; }
107 no warnings 'deprecated';
108 ${^ENCODING} = 42;
109 { local ${^ENCODING}; }
110 ${^ENCODING} = undef;
111 { local ${^ENCODING} = 37; }
112 EXPECT
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.