Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Inline CPAN distribution.

Report information
The Basics
Id: 53227
Status: resolved
Priority: 0/
Queue: Inline

People
Owner: Nobody in particular
Requestors: nick [...] ccl4.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in:
  • 0.30
  • 0.31
  • 0.32
  • 0.33
  • 0.34
  • 0.40
  • 0.41
  • 0.42
  • 0.43
  • 0.44
  • 0.44_01
  • 0.45
Fixed in: (no value)



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};
On Wed Dec 30 05:36:59 2009, nick@ccl4.org wrote:

Show quoted text
> --- 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};

Thanks Nicholas - I had seen the warning, but not got around to even thinking about it

This patch will be in the next Inline release.

Unfortunately, it's expected that I keep the CPAN source of this module in sync with the github source that Ingy set up, and I haven't yet worked out how I can modify the github source .... so I don't know when this "next Inline release" will take place. (I think there's a "New Year's Resolution" brewing wrt this state of affairs :-)

Cheers,
Rob


Fixed in Inline-0.46