in reply to CPAN.pm's ->get method destroys objects

Yours appears to overwrite $_, but that doesn't mean get() ordinarily destroys the object which calls it. Still, not localizing $_ is probably is a bug, if that's the source of the problem.

After Compline,
Zaxo

  • Comment on Re: CPAN.pm's ->get method destroys objects

Replies are listed 'Best First'.
Re: Re: CPAN.pm's ->get method destroys objects
by diotalevi (Canon) on Oct 24, 2003 at 14:57 UTC
    Ah I see. The original code went $_->get for @packages; so I kept the sense of that by just assigning to $_ in my example. That is indeed the problem. Substituting in  for my $pkg ( @packages ) { $pkg->get } corrected the problem.