1 # -*- buffer-read-only: t -*-
2 # !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
3 # This file is built by regen/warnings.pl.
4 # Any changes made here will be lost!
10 # Verify that we're called correctly so that warnings will work.
11 # Can't use Carp, since Carp uses us!
12 # String regexps because constant folding = smaller optree = less memory vs regexp literal
14 die sprintf "Incorrect use of pragma '%s' at %s line %d.\n", __PACKAGE__, +(caller)[1,2]
15 if __FILE__ !~ ( '(?x) \b '.__PACKAGE__.' \.pmc? \z' )
16 && __FILE__ =~ ( '(?x) \b (?i:'.__PACKAGE__.') \.pmc? \z' );
19 # Warnings Categories added in Perl 5.008
61 'uninitialized' => 82,
67 # Warnings Categories added in Perl 5.011
71 # Warnings Categories added in Perl 5.013
76 # Warnings Categories added in Perl 5.017
77 'experimental' => 102,
78 'experimental::lexical_subs' => 104,
79 'experimental::regex_sets' => 106,
80 'experimental::smartmatch' => 108,
82 # Warnings Categories added in Perl 5.019
83 'experimental::postderef' => 110,
84 'experimental::signatures' => 112,
87 # Warnings Categories added in Perl 5.021
88 'experimental::bitwise' => 116,
89 'experimental::const_attr' => 118,
90 'experimental::re_strict' => 120,
91 'experimental::refaliasing' => 122,
92 'experimental::win32_perlio' => 124,
97 # Warnings Categories added in Perl 5.025
98 'experimental::declared_refs' => 132,
100 # Warnings Categories added in Perl 5.027
101 'experimental::alpha_assertions' => 134,
102 'experimental::script_run' => 136,
105 # Warnings Categories added in Perl 5.029
106 'experimental::private_use' => 140,
107 'experimental::uniprop_wildcards' => 142,
108 'experimental::vlb' => 144,
112 'all' => "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55", # [0..75]
113 'ambiguous' => "\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [29]
114 'bareword' => "\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [30]
115 'closed' => "\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [6]
116 'closure' => "\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [1]
117 'debugging' => "\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [22]
118 'deprecated' => "\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [2]
119 'digit' => "\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [31]
120 'exec' => "\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [7]
121 'exiting' => "\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [3]
122 'experimental' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x55\x51\x15\x50\x51\x01", # [51..56,58..62,66..68,70..72]
123 'experimental::alpha_assertions' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00", # [67]
124 'experimental::bitwise' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00", # [58]
125 'experimental::const_attr' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00", # [59]
126 'experimental::declared_refs' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00", # [66]
127 'experimental::lexical_subs' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00", # [52]
128 'experimental::postderef' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00", # [55]
129 'experimental::private_use' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00", # [70]
130 'experimental::re_strict' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00", # [60]
131 'experimental::refaliasing' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00", # [61]
132 'experimental::regex_sets' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00", # [53]
133 'experimental::script_run' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00", # [68]
134 'experimental::signatures' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00", # [56]
135 'experimental::smartmatch' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00", # [54]
136 'experimental::uniprop_wildcards' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00", # [71]
137 'experimental::vlb' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01", # [72]
138 'experimental::win32_perlio' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00", # [62]
139 'glob' => "\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [4]
140 'illegalproto' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00", # [47]
141 'imprecision' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00", # [46]
142 'inplace' => "\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [23]
143 'internal' => "\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [24]
144 'io' => "\x00\x54\x55\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00", # [5..11,57]
145 'layer' => "\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [8]
146 'locale' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00", # [63]
147 'malloc' => "\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [25]
148 'misc' => "\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [12]
149 'missing' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00", # [64]
150 'newline' => "\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [9]
151 'non_unicode' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00", # [48]
152 'nonchar' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00", # [49]
153 'numeric' => "\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [13]
154 'once' => "\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [14]
155 'overflow' => "\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [15]
156 'pack' => "\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [16]
157 'parenthesis' => "\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [32]
158 'pipe' => "\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [10]
159 'portable' => "\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [17]
160 'precedence' => "\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [33]
161 'printf' => "\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [34]
162 'prototype' => "\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [35]
163 'qw' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [36]
164 'recursion' => "\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [18]
165 'redefine' => "\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [19]
166 'redundant' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00", # [65]
167 'regexp' => "\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [20]
168 'reserved' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [37]
169 'semicolon' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [38]
170 'severe' => "\x00\x00\x00\x00\x00\x54\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [21..25]
171 'shadow' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00", # [69]
172 'signal' => "\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [26]
173 'substr' => "\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [27]
174 'surrogate' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00", # [50]
175 'syntax' => "\x00\x00\x00\x00\x00\x00\x00\x55\x55\x15\x00\x40\x00\x00\x00\x00\x00\x00\x00", # [28..38,47]
176 'syscalls' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00", # [57]
177 'taint' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [39]
178 'threads' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00", # [40]
179 'uninitialized' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00", # [41]
180 'unopened' => "\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [11]
181 'unpack' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00", # [42]
182 'untie' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00", # [43]
183 'utf8' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x15\x00\x00\x00\x00\x00\x00", # [44,48..50]
184 'void' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00", # [45]
188 'all' => "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", # [0..75]
189 'ambiguous' => "\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [29]
190 'bareword' => "\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [30]
191 'closed' => "\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [6]
192 'closure' => "\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [1]
193 'debugging' => "\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [22]
194 'deprecated' => "\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [2]
195 'digit' => "\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [31]
196 'exec' => "\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [7]
197 'exiting' => "\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [3]
198 'experimental' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\xaa\xa2\x2a\xa0\xa2\x02", # [51..56,58..62,66..68,70..72]
199 'experimental::alpha_assertions' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00", # [67]
200 'experimental::bitwise' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00", # [58]
201 'experimental::const_attr' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00", # [59]
202 'experimental::declared_refs' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00", # [66]
203 'experimental::lexical_subs' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00", # [52]
204 'experimental::postderef' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00", # [55]
205 'experimental::private_use' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00", # [70]
206 'experimental::re_strict' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00", # [60]
207 'experimental::refaliasing' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00", # [61]
208 'experimental::regex_sets' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00", # [53]
209 'experimental::script_run' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00", # [68]
210 'experimental::signatures' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00", # [56]
211 'experimental::smartmatch' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00", # [54]
212 'experimental::uniprop_wildcards' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00", # [71]
213 'experimental::vlb' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02", # [72]
214 'experimental::win32_perlio' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00", # [62]
215 'glob' => "\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [4]
216 'illegalproto' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00", # [47]
217 'imprecision' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00", # [46]
218 'inplace' => "\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [23]
219 'internal' => "\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [24]
220 'io' => "\x00\xa8\xaa\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00", # [5..11,57]
221 'layer' => "\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [8]
222 'locale' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00", # [63]
223 'malloc' => "\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [25]
224 'misc' => "\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [12]
225 'missing' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00", # [64]
226 'newline' => "\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [9]
227 'non_unicode' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00", # [48]
228 'nonchar' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00", # [49]
229 'numeric' => "\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [13]
230 'once' => "\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [14]
231 'overflow' => "\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [15]
232 'pack' => "\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [16]
233 'parenthesis' => "\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [32]
234 'pipe' => "\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [10]
235 'portable' => "\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [17]
236 'precedence' => "\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [33]
237 'printf' => "\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [34]
238 'prototype' => "\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [35]
239 'qw' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [36]
240 'recursion' => "\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [18]
241 'redefine' => "\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [19]
242 'redundant' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00", # [65]
243 'regexp' => "\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [20]
244 'reserved' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [37]
245 'semicolon' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [38]
246 'severe' => "\x00\x00\x00\x00\x00\xa8\x0a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [21..25]
247 'shadow' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00", # [69]
248 'signal' => "\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [26]
249 'substr' => "\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [27]
250 'surrogate' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00", # [50]
251 'syntax' => "\x00\x00\x00\x00\x00\x00\x00\xaa\xaa\x2a\x00\x80\x00\x00\x00\x00\x00\x00\x00", # [28..38,47]
252 'syscalls' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00", # [57]
253 'taint' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [39]
254 'threads' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00", # [40]
255 'uninitialized' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00", # [41]
256 'unopened' => "\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [11]
257 'unpack' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00", # [42]
258 'untie' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00", # [43]
259 'utf8' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x2a\x00\x00\x00\x00\x00\x00", # [44,48..50]
260 'void' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00", # [45]
263 # These are used by various things, including our own tests
264 our $NONE = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
265 our $DEFAULT = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x00\x55\x51\x55\x50\x51\x01", # [2,4,22,23,25,52..56,58..63,66..68,70..72]
266 our $LAST_BIT = 146 ;
271 require Carp; # this initializes %CarpInternal
272 local $Carp::CarpInternal{'warnings'};
273 delete $Carp::CarpInternal{'warnings'};
279 my $want_len = ($LAST_BIT + 7) >> 3;
280 my $len = length($bits);
281 if ($len != $want_len) {
283 $bits = "\x00" x $want_len;
284 } elsif ($len > $want_len) {
285 substr $bits, $want_len, $len-$want_len, "";
287 my $a = vec($bits, $Offsets{all} >> 1, 2);
290 $bits .= chr($a) x ($want_len - $len);
302 $mask = _expand_bits($mask);
303 foreach my $word ( @_ ) {
304 if ($word eq 'FATAL') {
308 elsif ($word eq 'NONFATAL') {
312 elsif ($catmask = $Bits{$word}) {
314 $mask |= $DeadBits{$word} if $fatal ;
315 $mask = ~(~$mask | $DeadBits{$word}) if $no_fatal ;
318 { Croaker("Unknown warnings category '$word'")}
326 # called from B::Deparse.pm
327 push @_, 'all' unless @_ ;
328 return _bits("", @_) ;
335 my $mask = ${^WARNING_BITS} // ($^W ? $Bits{all} : $DEFAULT) ;
337 # append 'all' when implied (empty import list or after a lone
338 # "FATAL" or "NONFATAL")
340 if !@_ || (@_==1 && ($_[0] eq 'FATAL' || $_[0] eq 'NONFATAL'));
342 ${^WARNING_BITS} = _bits($mask, @_);
350 my $mask = ${^WARNING_BITS} // ($^W ? $Bits{all} : $DEFAULT) ;
352 # append 'all' when implied (empty import list or after a lone "FATAL")
353 push @_, 'all' if !@_ || @_==1 && $_[0] eq 'FATAL';
355 $mask = _expand_bits($mask);
356 foreach my $word ( @_ ) {
357 if ($word eq 'FATAL') {
360 elsif ($catmask = $Bits{$word}) {
361 $mask = ~(~$mask | $catmask | $DeadBits{$word});
364 { Croaker("Unknown warnings category '$word'")}
367 ${^WARNING_BITS} = $mask ;
370 my %builtin_type; @builtin_type{qw(SCALAR ARRAY HASH CODE REF GLOB LVALUE Regexp)} = ();
373 sub MESSAGE () { 4 };
383 my $has_message = $wanted & MESSAGE;
384 my $has_level = $wanted & LEVEL ;
387 if (@_ != ($has_message ? 3 : 2)) {
388 my $sub = (caller 1)[3];
389 my $syntax = $has_message
390 ? "category, level, 'message'"
392 Croaker("Usage: $sub($syntax)");
395 elsif (not @_ == 1 || @_ == ($has_message ? 2 : 0)) {
396 my $sub = (caller 1)[3];
397 my $syntax = $has_message ? "[category,] 'message'" : '[category]';
398 Croaker("Usage: $sub($syntax)");
401 my $message = pop if $has_message;
404 # check the category supplied.
406 if (my $type = ref $category) {
407 Croaker("not an object")
408 if exists $builtin_type{$type};
412 $offset = $Offsets{$category};
413 Croaker("Unknown warnings category '$category'")
414 unless defined $offset;
417 $category = (caller(1))[0] ;
418 $offset = $Offsets{$category};
419 Croaker("package '$category' not registered for warnings")
420 unless defined $offset ;
428 while (do { { package DB; $pkg = (caller($i++))[0] } } ) {
429 last unless @DB::args && $DB::args[0] =~ /^$category=/ ;
437 $i = _error_loc(); # see where Carp will allocate the error
440 # Default to 0 if caller returns nothing. Default to $DEFAULT if it
441 # explicitly returns undef.
442 my(@callers_bitmask) = (caller($i))[9] ;
443 my $callers_bitmask =
444 @callers_bitmask ? $callers_bitmask[0] // $DEFAULT : 0 ;
445 length($callers_bitmask) > ($offset >> 3) or $offset = $Offsets{all};
448 foreach my $type (FATAL, NORMAL) {
449 next unless $wanted & $type;
451 push @results, vec($callers_bitmask, $offset + $type - 1, 1);
454 # &enabled and &fatal_enabled
455 return $results[0] unless $has_message;
457 # &warnif, and the category is neither enabled as warning nor as fatal
458 return if ($wanted & (NORMAL | FATAL | MESSAGE))
459 == (NORMAL | FATAL | MESSAGE)
460 && !($results[0] || $results[1]);
462 # If we have an explicit level, bypass Carp.
463 if ($has_level and @callers_bitmask) {
464 # logic copied from util.c:mess_sv
465 my $stuff = " at " . join " line ", (caller $i)[1,2];
466 $stuff .= sprintf ", <%s> %s %d",
468 ($/ eq "\n" ? "line" : "chunk"), $.
469 if $. && ${^LAST_FH};
470 die "$message$stuff.\n" if $results[0];
471 return warn "$message$stuff.\n";
475 Carp::croak($message) if $results[0];
476 # will always get here for &warn. will only get here for &warnif if the
477 # category is enabled
478 Carp::carp($message);
486 vec($mask, $bit, 1) = 1;
490 sub register_categories
494 for my $name (@names) {
495 if (! defined $Bits{$name}) {
496 $Offsets{$name} = $LAST_BIT;
497 $Bits{$name} = _mkMask($LAST_BIT++);
498 $DeadBits{$name} = _mkMask($LAST_BIT++);
499 if (length($Bits{$name}) > length($Bits{all})) {
500 $Bits{all} .= "\x55";
501 $DeadBits{all} .= "\xaa";
509 goto &Carp::short_error_loc; # don't introduce another stack frame
514 return __chk(NORMAL, @_);
519 return __chk(FATAL, @_);
524 return __chk(FATAL | MESSAGE, @_);
529 return __chk(NORMAL | FATAL | MESSAGE, @_);
534 return __chk(NORMAL | LEVEL, @_);
537 sub fatal_enabled_at_level
539 return __chk(FATAL | LEVEL, @_);
544 return __chk(FATAL | MESSAGE | LEVEL, @_);
549 return __chk(NORMAL | FATAL | MESSAGE | LEVEL, @_);
552 # These are not part of any public interface, so we can delete them to save
554 delete @warnings::{qw(NORMAL FATAL MESSAGE LEVEL)};
561 warnings - Perl pragma to control optional warnings
571 use warnings::register;
572 if (warnings::enabled()) {
573 warnings::warn("some warning");
576 if (warnings::enabled("void")) {
577 warnings::warn("void", "some warning");
580 if (warnings::enabled($object)) {
581 warnings::warn($object, "some warning");
584 warnings::warnif("some warning");
585 warnings::warnif("void", "some warning");
586 warnings::warnif($object, "some warning");
590 The C<warnings> pragma gives control over which warnings are enabled in
591 which parts of a Perl program. It's a more flexible alternative for
592 both the command line flag B<-w> and the equivalent Perl variable,
595 This pragma works just like the C<strict> pragma.
596 This means that the scope of the warning pragma is limited to the
597 enclosing block. It also means that the pragma setting will not
598 leak across files (via C<use>, C<require> or C<do>). This allows
599 authors to independently define the degree of warning checks that will
600 be applied to their module.
602 By default, optional warnings are disabled, so any legacy code that
603 doesn't attempt to control the warnings will work unchanged.
605 All warnings are enabled in a block by either of these:
610 Similarly all warnings are disabled in a block by either of these:
615 For example, consider the code below:
625 The code in the enclosing block has warnings enabled, but the inner
626 block has them disabled. In this case that means the assignment to the
627 scalar C<$c> will trip the C<"Scalar value @a[0] better written as $a[0]">
628 warning, but the assignment to the scalar C<$b> will not.
630 =head2 Default Warnings and Optional Warnings
632 Before the introduction of lexical warnings, Perl had two classes of
633 warnings: mandatory and optional.
635 As its name suggests, if your code tripped a mandatory warning, you
636 would get a warning whether you wanted it or not.
637 For example, the code below would always produce an C<"isn't numeric">
638 warning about the "2:".
642 With the introduction of lexical warnings, mandatory warnings now become
643 I<default> warnings. The difference is that although the previously
644 mandatory warnings are still enabled by default, they can then be
645 subsequently enabled or disabled with the lexical warning pragma. For
646 example, in the code below, an C<"isn't numeric"> warning will only
647 be reported for the C<$a> variable.
653 Note that neither the B<-w> flag or the C<$^W> can be used to
654 disable/enable default warnings. They are still mandatory in this case.
656 =head2 What's wrong with B<-w> and C<$^W>
658 Although very useful, the big problem with using B<-w> on the command
659 line to enable warnings is that it is all or nothing. Take the typical
660 scenario when you are writing a Perl program. Parts of the code you
661 will write yourself, but it's very likely that you will make use of
662 pre-written Perl modules. If you use the B<-w> flag in this case, you
663 end up enabling warnings in pieces of code that you haven't written.
665 Similarly, using C<$^W> to either disable or enable blocks of code is
666 fundamentally flawed. For a start, say you want to disable warnings in
667 a block of code. You might expect this to be enough to do the trick:
675 When this code is run with the B<-w> flag, a warning will be produced
676 for the C<$a> line: C<"Reversed += operator">.
678 The problem is that Perl has both compile-time and run-time warnings. To
679 disable compile-time warnings you need to rewrite the code like this:
687 The other big problem with C<$^W> is the way you can inadvertently
688 change the warning setting in unexpected places in your code. For example,
689 when the code below is run (without the B<-w> flag), the second call
690 to C<doit> will trip a C<"Use of uninitialized value"> warning, whereas
705 This is a side-effect of C<$^W> being dynamically scoped.
707 Lexical warnings get around these limitations by allowing finer control
708 over where warnings can or can't be tripped.
710 =head2 Controlling Warnings from the Command Line
712 There are three Command Line flags that can be used to control when
713 warnings are (or aren't) produced:
720 This is the existing flag. If the lexical warnings pragma is B<not>
721 used in any of you code, or any of the modules that you use, this flag
722 will enable warnings everywhere. See L</Backward Compatibility> for
723 details of how this flag interacts with lexical warnings.
728 If the B<-W> flag is used on the command line, it will enable all warnings
729 throughout the program regardless of whether warnings were disabled
730 locally using C<no warnings> or C<$^W =0>.
731 This includes all files that get
732 included via C<use>, C<require> or C<do>.
733 Think of it as the Perl equivalent of the "lint" command.
738 Does the exact opposite to the B<-W> flag, i.e. it disables all warnings.
742 =head2 Backward Compatibility
744 If you are used to working with a version of Perl prior to the
745 introduction of lexically scoped warnings, or have code that uses both
746 lexical warnings and C<$^W>, this section will describe how they interact.
748 How Lexical Warnings interact with B<-w>/C<$^W>:
754 If none of the three command line flags (B<-w>, B<-W> or B<-X>) that
755 control warnings is used and neither C<$^W> nor the C<warnings> pragma
756 are used, then default warnings will be enabled and optional warnings
758 This means that legacy code that doesn't attempt to control the warnings
763 The B<-w> flag just sets the global C<$^W> variable as in 5.005. This
764 means that any legacy code that currently relies on manipulating C<$^W>
765 to control warning behavior will still work as is.
769 Apart from now being a boolean, the C<$^W> variable operates in exactly
770 the same horrible uncontrolled global way, except that it cannot
771 disable/enable default warnings.
775 If a piece of code is under the control of the C<warnings> pragma,
776 both the C<$^W> variable and the B<-w> flag will be ignored for the
777 scope of the lexical warning.
781 The only way to override a lexical warnings setting is with the B<-W>
782 or B<-X> command line flags.
786 The combined effect of 3 & 4 is that it will allow code which uses
787 the C<warnings> pragma to control the warning behavior of $^W-type
788 code (using a C<local $^W=0>) if it really wants to, but not vice-versa.
790 =head2 Category Hierarchy
791 X<warning, categories>
793 A hierarchy of "categories" have been defined to allow groups of warnings
794 to be enabled/disabled in isolation.
796 The current hierarchy is:
808 | +- experimental::alpha_assertions
810 | +- experimental::bitwise
812 | +- experimental::const_attr
814 | +- experimental::declared_refs
816 | +- experimental::lexical_subs
818 | +- experimental::postderef
820 | +- experimental::private_use
822 | +- experimental::re_strict
824 | +- experimental::refaliasing
826 | +- experimental::regex_sets
828 | +- experimental::script_run
830 | +- experimental::signatures
832 | +- experimental::smartmatch
834 | +- experimental::uniprop_wildcards
836 | +- experimental::vlb
838 | +- experimental::win32_perlio
944 Just like the "strict" pragma any of these categories can be combined
946 use warnings qw(void redefine);
947 no warnings qw(io syntax untie);
949 Also like the "strict" pragma, if there is more than one instance of the
950 C<warnings> pragma in a given scope the cumulative effect is additive.
952 use warnings qw(void); # only "void" warnings enabled
954 use warnings qw(io); # only "void" & "io" warnings enabled
956 no warnings qw(void); # only "io" warnings enabled
958 To determine which category a specific warning has been assigned to see
961 Note: Before Perl 5.8.0, the lexical warnings category "deprecated" was a
962 sub-category of the "syntax" category. It is now a top-level category
965 Note: Before 5.21.0, the "missing" lexical warnings category was
966 internally defined to be the same as the "uninitialized" category. It
967 is now a top-level category in its own right.
969 =head2 Fatal Warnings
972 The presence of the word "FATAL" in the category list will escalate
973 warnings in those categories into fatal errors in that lexical scope.
975 B<NOTE:> FATAL warnings should be used with care, particularly
976 C<< FATAL => 'all' >>.
978 Libraries using L<warnings::warn|/FUNCTIONS> for custom warning categories
979 generally don't expect L<warnings::warn|/FUNCTIONS> to be fatal and can wind up
980 in an unexpected state as a result. For XS modules issuing categorized
981 warnings, such unanticipated exceptions could also expose memory leak bugs.
983 Moreover, the Perl interpreter itself has had serious bugs involving
984 fatalized warnings. For a summary of resolved and unresolved problems as
985 of January 2015, please see
986 L<this perl5-porters post|http://www.nntp.perl.org/group/perl.perl5.porters/2015/01/msg225235.html>.
988 While some developers find fatalizing some warnings to be a useful
989 defensive programming technique, using C<< FATAL => 'all' >> to fatalize
990 all possible warning categories -- including custom ones -- is particularly
991 risky. Therefore, the use of C<< FATAL => 'all' >> is
992 L<discouraged|perlpolicy/discouraged>.
994 The L<strictures|strictures/VERSION-2> module on CPAN offers one example of
995 a warnings subset that the module's authors believe is relatively safe to
998 B<NOTE:> users of FATAL warnings, especially those using
999 C<< FATAL => 'all' >>, should be fully aware that they are risking future
1000 portability of their programs by doing so. Perl makes absolutely no
1001 commitments to not introduce new warnings or warnings categories in the
1002 future; indeed, we explicitly reserve the right to do so. Code that may
1003 not warn now may warn in a future release of Perl if the Perl5 development
1004 team deems it in the best interests of the community to do so. Should code
1005 using FATAL warnings break due to the introduction of a new warning we will
1006 NOT consider it an incompatible change. Users of FATAL warnings should
1007 take special caution during upgrades to check to see if their code triggers
1008 any new warnings and should pay particular attention to the fine print of
1009 the documentation of the features they use to ensure they do not exploit
1010 features that are documented as risky, deprecated, or unspecified, or where
1011 the documentation says "so don't do that", or anything with the same sense
1012 and spirit. Use of such features in combination with FATAL warnings is
1013 ENTIRELY AT THE USER'S RISK.
1015 The following documentation describes how to use FATAL warnings but the
1016 perl5 porters strongly recommend that you understand the risks before doing
1017 so, especially for library code intended for use by others, as there is no
1018 way for downstream users to change the choice of fatal categories.
1020 In the code below, the use of C<time>, C<length>
1021 and C<join> can all produce a C<"Useless use of xxx in void context">
1029 use warnings FATAL => qw(void);
1037 When run it produces this output
1039 Useless use of time in void context at fatal line 3.
1040 Useless use of length in void context at fatal line 7.
1042 The scope where C<length> is used has escalated the C<void> warnings
1043 category into a fatal error, so the program terminates immediately when it
1044 encounters the warning.
1046 To explicitly turn off a "FATAL" warning you just disable the warning
1047 it is associated with. So, for example, to disable the "void" warning
1048 in the example above, either of these will do the trick:
1050 no warnings qw(void);
1051 no warnings FATAL => qw(void);
1053 If you want to downgrade a warning that has been escalated into a fatal
1054 error back to a normal warning, you can use the "NONFATAL" keyword. For
1055 example, the code below will promote all warnings into fatal errors,
1056 except for those in the "syntax" category.
1058 use warnings FATAL => 'all', NONFATAL => 'syntax';
1060 As of Perl 5.20, instead of C<< use warnings FATAL => 'all'; >> you can
1063 use v5.20; # Perl 5.20 or greater is required for the following
1064 use warnings 'FATAL'; # short form of "use warnings FATAL => 'all';"
1066 If you want your program to be compatible with versions of Perl before
1067 5.20, you must use C<< use warnings FATAL => 'all'; >> instead. (In
1068 previous versions of Perl, the behavior of the statements
1069 C<< use warnings 'FATAL'; >>, C<< use warnings 'NONFATAL'; >> and
1070 C<< no warnings 'FATAL'; >> was unspecified; they did not behave as if
1071 they included the C<< => 'all' >> portion. As of 5.20, they do.)
1073 =head2 Reporting Warnings from a Module
1074 X<warning, reporting> X<warning, registering>
1076 The C<warnings> pragma provides a number of functions that are useful for
1077 module authors. These are used when you want to report a module-specific
1078 warning to a calling module has enabled warnings via the C<warnings>
1081 Consider the module C<MyMod::Abc> below.
1085 use warnings::register;
1089 if ($path !~ m#^/#) {
1090 warnings::warn("changing relative path to /var/abc")
1091 if warnings::enabled();
1092 $path = "/var/abc/$path";
1098 The call to C<warnings::register> will create a new warnings category
1099 called "MyMod::Abc", i.e. the new category name matches the current
1100 package name. The C<open> function in the module will display a warning
1101 message if it gets given a relative path as a parameter. This warnings
1102 will only be displayed if the code that uses C<MyMod::Abc> has actually
1103 enabled them with the C<warnings> pragma like below.
1106 use warnings 'MyMod::Abc';
1108 abc::open("../fred.txt");
1110 It is also possible to test whether the pre-defined warnings categories are
1111 set in the calling module with the C<warnings::enabled> function. Consider
1112 this snippet of code:
1117 if (warnings::enabled("deprecated")) {
1118 warnings::warn("deprecated",
1119 "open is deprecated, use new instead");
1128 The function C<open> has been deprecated, so code has been included to
1129 display a warning message whenever the calling module has (at least) the
1130 "deprecated" warnings category enabled. Something like this, say.
1132 use warnings 'deprecated';
1135 MyMod::Abc::open($filename);
1137 Either the C<warnings::warn> or C<warnings::warnif> function should be
1138 used to actually display the warnings message. This is because they can
1139 make use of the feature that allows warnings to be escalated into fatal
1140 errors. So in this case
1143 use warnings FATAL => 'MyMod::Abc';
1145 MyMod::Abc::open('../fred.txt');
1147 the C<warnings::warnif> function will detect this and die after
1148 displaying the warning message.
1150 The three warnings functions, C<warnings::warn>, C<warnings::warnif>
1151 and C<warnings::enabled> can optionally take an object reference in place
1152 of a category name. In this case the functions will use the class name
1153 of the object as the warnings category.
1155 Consider this example:
1160 use warnings::register;
1173 if ($value % 2 && warnings::enabled($self))
1174 { warnings::warn($self, "Odd numbers are unsafe") }
1181 $self->check($value);
1189 use warnings::register;
1191 our @ISA = qw( Original );
1201 The code below makes use of both modules, but it only enables warnings from
1206 use warnings 'Derived';
1207 my $a = Original->new();
1209 my $b = Derived->new();
1212 When this code is run only the C<Derived> object, C<$b>, will generate
1215 Odd numbers are unsafe at main.pl line 7
1217 Notice also that the warning is reported at the line where the object is first
1220 When registering new categories of warning, you can supply more names to
1221 warnings::register like this:
1224 use warnings::register qw(format precision);
1228 warnings::warnif('MyModule::format', '...');
1232 Note: The functions with names ending in C<_at_level> were added in Perl
1237 =item use warnings::register
1239 Creates a new warnings category with the same name as the package where
1240 the call to the pragma is used.
1242 =item warnings::enabled()
1244 Use the warnings category with the same name as the current package.
1246 Return TRUE if that warnings category is enabled in the calling module.
1247 Otherwise returns FALSE.
1249 =item warnings::enabled($category)
1251 Return TRUE if the warnings category, C<$category>, is enabled in the
1253 Otherwise returns FALSE.
1255 =item warnings::enabled($object)
1257 Use the name of the class for the object reference, C<$object>, as the
1260 Return TRUE if that warnings category is enabled in the first scope
1261 where the object is used.
1262 Otherwise returns FALSE.
1264 =item warnings::enabled_at_level($category, $level)
1266 Like C<warnings::enabled>, but $level specifies the exact call frame, 0
1267 being the immediate caller.
1269 =item warnings::fatal_enabled()
1271 Return TRUE if the warnings category with the same name as the current
1272 package has been set to FATAL in the calling module.
1273 Otherwise returns FALSE.
1275 =item warnings::fatal_enabled($category)
1277 Return TRUE if the warnings category C<$category> has been set to FATAL in
1279 Otherwise returns FALSE.
1281 =item warnings::fatal_enabled($object)
1283 Use the name of the class for the object reference, C<$object>, as the
1286 Return TRUE if that warnings category has been set to FATAL in the first
1287 scope where the object is used.
1288 Otherwise returns FALSE.
1290 =item warnings::fatal_enabled_at_level($category, $level)
1292 Like C<warnings::fatal_enabled>, but $level specifies the exact call frame,
1293 0 being the immediate caller.
1295 =item warnings::warn($message)
1297 Print C<$message> to STDERR.
1299 Use the warnings category with the same name as the current package.
1301 If that warnings category has been set to "FATAL" in the calling module
1302 then die. Otherwise return.
1304 =item warnings::warn($category, $message)
1306 Print C<$message> to STDERR.
1308 If the warnings category, C<$category>, has been set to "FATAL" in the
1309 calling module then die. Otherwise return.
1311 =item warnings::warn($object, $message)
1313 Print C<$message> to STDERR.
1315 Use the name of the class for the object reference, C<$object>, as the
1318 If that warnings category has been set to "FATAL" in the scope where C<$object>
1319 is first used then die. Otherwise return.
1321 =item warnings::warn_at_level($category, $level, $message)
1323 Like C<warnings::warn>, but $level specifies the exact call frame,
1324 0 being the immediate caller.
1326 =item warnings::warnif($message)
1330 if (warnings::enabled())
1331 { warnings::warn($message) }
1333 =item warnings::warnif($category, $message)
1337 if (warnings::enabled($category))
1338 { warnings::warn($category, $message) }
1340 =item warnings::warnif($object, $message)
1344 if (warnings::enabled($object))
1345 { warnings::warn($object, $message) }
1347 =item warnings::warnif_at_level($category, $level, $message)
1349 Like C<warnings::warnif>, but $level specifies the exact call frame,
1350 0 being the immediate caller.
1352 =item warnings::register_categories(@names)
1354 This registers warning categories for the given names and is primarily for
1355 use by the warnings::register pragma.
1359 See also L<perlmodlib/Pragmatic Modules> and L<perldiag>.