Subject: | undesirable change of SV flags |
Date: | Sun, 30 Jun 2013 20:43:56 +0200 |
To: | bug-Data-Dump [...] rt.cpan.org |
From: | Karel Miko <karel.miko [...] gmail.com> |
Hi,
I have experienced some troubles when using Data::Dump with Mojo::JSON
more info:
https://groups.google.com/forum/?hl=en#!topic/mojolicious/33AustuMAW8
It turned out that under some circumstances Data::Dump sets SVp_IOK (maybe
also SVp_NOK) flag on SV beeing dumped.
In my opinion a module (Data::Dump) intended for dumping/printing data
structure should avoid changing SV flags on data being printed/dumped so I
think this is a Data::Dump's bug.
The trouble is with this part:
do {no warnings 'numeric'; $$rval + 0 eq $$rval}
where SVp_IOK flag is turned on after using $$rval in numeric context.
I have prepared a patch based on inspecting scalar via
B::svref_2object(..)->FLAGS - as B is part of perl core I hope it is not a
big trouble to have as a dependency.
I am sending the patch attached to this RT as well as via github pull request.
--
Karel
Message body is not shown because sender requested not to inline it.