Show us a bit more of your own code.

Ok, I first:

package PUA; use LWP::Parallel::UserAgent; @PUA::ISA = qw(LWP::Parallel::UserAgent); sub on_return { # print '@_ = (' . join(', ',map{"'$_'"} @_) .")\n"; my ($self,$request, $response, $entry) = @_; $self->discard_entry($entry); } 1;
#!/usr/bin/perl use strict; use Data::Dumper; $Data::Dumper::Indent = 1; use HTTP::Request; use PUA; my $ua = PUA->new(); for(<*.pl>) { my $request = HTTP::Request->new('GET',"file://$ENV{HOME}/perlmonk +s/$_"); if( my $res = $ua->register($request)) { print STDERR $res->error_as_HTML; } } print Dumper($ua);

Output:

$VAR1 = bless( { 'ordpend_connections' => [], 'entries_by_sockets' => {}, 'max_hosts' => 7, 'seen_request' => {}, 'handle_duplicates' => 0, 'requests_redirectable' => [ 'GET', 'HEAD' ], 'from' => undef, 'timeout' => 180, 'handle_response' => 1, 'parse_head' => 1, 'remember_failures' => 0, 'entries_by_requests' => {}, 'max_req' => 5, 'current_connections' => {}, 'max_redirect' => 7, 'nonblock' => 0, 'previous_requests' => {}, 'select_out' => bless( [ undef, 0 ], 'IO::Select' ), 'pending_connections' => {}, 'failed_connections' => {}, 'protocols_forbidden' => undef, 'no_proxy' => [], 'protocols_allowed' => undef, 'use_eval' => 1, 'agent' => 'libwww-perl/5.805', 'handle_in_order' => 0, 'def_headers' => undef, 'proxy' => {}, 'select_in' => bless( [ undef, 0 ], 'IO::Select' ), 'max_size' => undef }, 'PUA' );

Works like expected. No Request/Response object in $ua. If I comment out the $self->discard_entry($entry) line in PUA.pm, the $ua object is stuffed with the entries in the anonymous array keyed as ordpend_connections in the object's hash.

Your turn. I suspect usage errors.

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

In reply to Re: Problems with 'discard_entry' in LWP::Parallel::Useragent by shmem
in thread LWP::Parallel::UserAgent discard_entry does not delete entry objects by perlmonkey2

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.