https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7208

Kevin A. McGrail <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #10 from Kevin A. McGrail <[email protected]> ---
(In reply to andrew from comment #9)
> Thank you Kevin.
> 
> That fixes it, for the record i am on perl v5.10.1 on CentOS 6

Thanks. From http://perldoc.perl.org/functions/keys.html, it started in perl
5.14 and the code as it was, should have had a use 5.014 in it since it
requires perl 5.014.  I believe the typecasting is more flexible supporting
more perl versions and is the correct solution, then.

"Starting with Perl 5.14, keys can take a scalar EXPR, which must contain a
reference to an unblessed hash or array. The argument will be dereferenced
automatically. This aspect of keys is considered highly experimental. The exact
behaviour may change in a future version of Perl.

        for (keys $hashref) { ... }
        for (keys $obj->get_arrayref) { ... }

To avoid confusing would-be users of your code who are running earlier versions
of Perl with mysterious syntax errors, put this sort of thing at the top of
your file to signal that your code will work only on Perls of a recent vintage:

        use 5.012;    # so keys/values/each work on arrays
        use 5.014;    # so keys/values/each work on scalars (experimental)"


Committed in trunk and 3.4

 svn commit -m 'Bug 7208 to typecast for keys/each in URILocalBL.pm'
Sending        lib/Mail/SpamAssassin/Plugin/URILocalBL.pm
Transmitting file data .
Committed revision 1684653.

3.4 was accidentally part of en masse commit 1684648 that was a consequence of
hitting return to soon ;-)

regards,
KAM

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to