Subject: | warning on defined %hash |
C<defined %hash> has been deprecated in Perl 5 for around 10 years. 5.12.0 will warn about it. Inline currently uses it:
t/00init.t ........... ok
t/01syntax.t ......... defined(%hash) is deprecated at blib/lib/Inline.pm (autosplit into
blib/lib/auto/Inline/check_config_file.al) line 671 (#1)
(D deprecated) defined() is not usually useful on hashes because it
checks for an undefined scalar value. If you want to see if the hash
is empty, just use if (%hash) { # not empty } for example.
(Maybe you should just omit the defined()?)
t/01syntax.t ......... ok
[etc]
The code in question wants to know whether Inline::Config has been loaded. This warning-free alternative works just as well:
--- Inline.pm~ 2008-11-21 09:37:07.000000000 +0000
+++ Inline.pm 2009-12-30 10:28:55.000000000 +0000
@@ -668,7 +668,7 @@
my ($DIRECTORY, %config);
my $o = shift;
- croak M14_usage_Config() if defined %main::Inline::Config::;
+ croak M14_usage_Config() if %main::Inline::Config::;
croak M63_no_source($o->{API}{pkg})
if $o->{INLINE}{md5} eq $o->{API}{code};