warnin's - like warnings, but with more casual language
Version 0.0.4
use strict; use warnin's; #turn warnin's on
my ($x, $y);
#warnings: Use of uninitialized value in addition (+) at z.pl line 16. #warnin's: Yer usin' a variable that ain't got a value in addition (+) at z.pl line 16. $x = $x + 4;
no warnin's; #turn warnin's off
$y = $y + 1; #no warning
use warnin's; #turn warnin's back on
#warnings: Argument "" isn't numeric in numeric eq (==) at z.pl line 116.
#warnin's: Suffering succatash! Ya used da strin' "" in numeric eq (==) at z.pl line 116.
if ("" == 0) {
$y++
}
This pragma works just like the warnings pragma, but replaces the normal warnings with "humorous" warnin's. Currently the following warnings have been replaced:
Chas. J. Owens IV, <chas.owens at gmail.com>
Any code that parses warning mesages will likely fail.
It overrides the __WARN__ signal handler, so any code that also
overrides it will stomp warnin's and vice versa
There are probably problems with how the messages are being changed
It is probably very slow.
saying no warnin's; and then use warnings; doesn't turn off
warnin's (need to unhook the handler in unimport I guess).
James Mastros for spelling warnings incorrectly http://www.nntp.perl.org/group/perl.perl5.porters/2009/04/msg145454.html.
Ronald J Kimball for pointing out the mistake.
Others on StackOverflow.com for creating warnin' messages http://stackoverflow.com/questions/711117/what-warnings-would-you-like-a-warnins-pragma-to-throw
David Nicol for suggesting warnin's instead of warnins
Copyright 2009 Chas. J. Owens IV, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.