On 04/05/2013 20:47, Greg London wrote:
is there a way to suppress this warning from inside testpackage.pm somehow?
...
#!/usr/bin/env perl
use warnings;
use strict;
use testpackage;
somesub('tricky');
print "hello, tricky is '$main::tricky'\n";
When I run this script, I get the warning:
Name "main::tricky" used only once: possible typo at ./testscript.pl
is there a way to suppress this error from inside testpackage.pm somehow?
%SIG is global, so ...
$SIG{__WARN__} = sub {
my @args = @_;
# do whatever you want with the warning
}
--
David Cantrell | semi-evolved ape-thing
Today's previously unreported paraphilia is tomorrow's Internet sensation
_______________________________________________
Boston-pm mailing list
[email protected]
http://mail.pm.org/mailman/listinfo/boston-pm