Closed p5pRT closed 9 years ago
The library module\, "warnings" shows an example for 'warnif' where there should be an example for warnings:enabled as shown in the extracted text:
[quote] It is also possible to test whether the pre-defined warnings categories are set in the calling module with the "warnings::enabled" function. Consider this snippet of code:
package MyMod::Abc;
sub open { warnings::warnif("deprecated"\, "open is deprecated\, use new instead"); [/quote]
On Sun Sep 13 17:18:03 2015\, LAWalsh wrote:
The library module\, "warnings" shows an example for 'warnif' where there should be an example for warnings:enabled as shown in the extracted text:
[quote] It is also possible to test whether the pre-defined warnings categories are set in the calling module with the "warnings::enabled" function. Consider this snippet of code:
package MyMod::Abc;
sub open { warnings::warnif("deprecated"\, "open is deprecated\, use new instead"); [/quote]
It looks like this was changed by mistake in 7e6d00f88633359fc96f8d1e8d7c3aa419c0d976 which introduced warnings::warnif() and changed most uses of warnings::enabled() in core to use warnings::warnig()\, including this one.
I've attached two patches\, one to sync the $VERSION of regen/warnings.pl and lib/warnings.pm\, since the first generates the second\, and two to partly revert the change to the example.
Tony
The RT System itself - Status changed from 'new' to 'open'
On Sun Sep 13 21:35:47 2015\, tonyc wrote:
On Sun Sep 13 17:18:03 2015\, LAWalsh wrote:
The library module\, "warnings" shows an example for 'warnif' where there should be an example for warnings:enabled as shown in the extracted text:
[quote] It is also possible to test whether the pre-defined warnings categories are set in the calling module with the "warnings::enabled" function. Consider this snippet of code:
package MyMod::Abc;
sub open { warnings::warnif("deprecated"\, "open is deprecated\, use new instead"); [/quote]
It looks like this was changed by mistake in 7e6d00f88633359fc96f8d1e8d7c3aa419c0d976 which introduced warnings::warnif() and changed most uses of warnings::enabled() in core to use warnings::warnig()\, including this one.
I've attached two patches\, one to sync the $VERSION of regen/warnings.pl and lib/warnings.pm\, since the first generates the second\, and two to partly revert the change to the example.
Tony
+1
-- James E Keenan (jkeenan@cpan.org)
On Sun Sep 13 21:35:47 2015\, tonyc wrote:
On Sun Sep 13 17:18:03 2015\, LAWalsh wrote:
The library module\, "warnings" shows an example for 'warnif' where there should be an example for warnings:enabled as shown in the extracted text:
[quote] It is also possible to test whether the pre-defined warnings categories are set in the calling module with the "warnings::enabled" function. Consider this snippet of code:
package MyMod::Abc;
sub open { warnings::warnif("deprecated"\, "open is deprecated\, use new instead"); [/quote]
It looks like this was changed by mistake in 7e6d00f88633359fc96f8d1e8d7c3aa419c0d976 which introduced warnings::warnif() and changed most uses of warnings::enabled() in core to use warnings::warnig()\, including this one.
I've attached two patches\, one to sync the $VERSION of regen/warnings.pl and lib/warnings.pm\, since the first generates the second\, and two to partly revert the change to the example.
Applied as 3d8ff82557d67bc81d10600b537a57f90f401a4f and 4a21999a595cf89f78d57aa5b3fdf3fbfa638fb1\, though I had to bump the version again.
Tony
@tonycoz - Status changed from 'open' to 'resolved'
Migrated from rt.perl.org#126051 (status was 'resolved')
Searchable as RT126051$