bsb has asked for the wisdom of the Perl Monks concerning the following question:

List::Util::first seems to be leaking for me.
perl -MList::Util=first -e 'sub a { my $a; first { $a } 0}; a() while +1' $ vm `pgrep -f List::Util` VmSize: 53940 kB VmSize: 85884 kB VmSize: 117564 kB alias vm='perl -e '\''do{ print `grep VmSize /proc/$ARGV[0]/status` }w +hile(sleep(1))'\'''
List::Util version 1.13, this is perl, v5.8.4 built for i386-linux-thread-multi.

When I use the pure perl alternative version in List/Util.pm the leak doesn't occur.

Can someone else confirm this for me?

Brad

Replies are listed 'Best First'.
Re: List::Util::first leak?
by davidrw (Prior) on Jul 04, 2005 at 02:28 UTC
    Yep -- Look at the current (1.17 from May 2005 ; 1.13 is almost 2 years old) version's ChangeLog for List::Util:
      1.15 -- Fri May 13 11:01:15 CDT 2005
    
      Bug Fixes
        * Fixed memory leak in first()
    
Re: List::Util::first leak?
by BrowserUk (Patriarch) on Jul 04, 2005 at 02:45 UTC

    Confirmed. It is a known problem and I can confirm that it is fixed in 1.17 from CPAN (albeit on win32).


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
    "Science is about questioning the status quo. Questioning authority".
    The "good enough" maybe good enough for the now, and perfection maybe unobtainable, but that should not preclude us from striving for perfection, when time, circumstance or desire allow.