develooper Front page | perl.perl5.porters | Postings from January 2013

Re: patch for perl5db -> You can t FIRSTKEY with the %~ hash

Thread Previous | Thread Next
Ricardo Signes
January 25, 2013 03:58
Re: patch for perl5db -> You can t FIRSTKEY with the %~ hash
Message ID:
* kevin dawson <> [2012-01-26T16:03:50]
> On 24/01/12 19:48, Ricardo Signes wrote:
> >The problem here is that somewhere along the way, you have loaded
> >File::HomeDir, which is not a core part of Perl.  The "X" command uses
> > to dump all the globals, including %~, which File::HomeDir has
> >tied.
> >
> >That tied variable does not provide the full tied hash interface.  Most
> >importantly, it can't properly work with "keys" or "each"
> I have talked to AdamK and he has updated File::HomeDir upgraded to 0.99
> Changes include
>     The use of deprecated %~ now emits a warning
> in lib/File/
>     Carp::Carp("The tied %~ hash has been deprecated");
> Now the interesting bit, no difference at all

Happy almost anniversary, bug!

Well, what Adam uploaded doesn't actually fix the problem!  It still doesn't
implement the method, it dies when you call it, and so of course *that* didn't
fix this problem.

> Q. who do I talk to about


Back when this came up, I said that the solution was to patch to
emit some "(and this part failed)" marker when a part of a dump failed, so that
the rest could continue.  Nobody did that, so I have.  I just pushed it to
branch rjbs/dumpvar-eval.

With that change, this program:

  use File::HomeDir;
  require "code/perl5/lib/";
  dumpValue({ x => \%~, z => [ 1, 2, 3 ] });

Now emits:

  'x' => HASH(0x7f8c3a9ccfa8)
        << value could not be dumped: You can't FIRSTKEY with the %~ hash at code/perl5/lib/ line 217.
  'z' => ARRAY(0x7f8c3a8298e0)
     0  1
     1  2
     2  3

If no one sees a reason to object, I will apply this to blead soon.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About