Subscribe to feed Recent Actions from vsespb

  • Ron Savage commented on Seeking code to find a free TCP/IP port

    The code using this is a test, t/daemon.t, in Pod::Webserver, which I recently adopted. It (obviously) runs a daemon (which I very rarely do in my code), using:
    my $port = $ENV{'PODWEBSERVERPORT'};
    Due to fails via CPAN testers, I changed that to:
    my $port = $ENV{'PODWEBSERVERPORT'} || empty_port();
    But then the connexion was always refused. Putting that in a BEGIN block worked.

    I've saved your links in my annotated list of modules. $many x $thanx;

  • commented on Padre 1.00 has been released

    install Padre:

    Invalid version format (non-numeric data) at C:/strawberry/perl/site/lib/Padre/ line 126.
    BEGIN failed--compilation aborted at C:/strawberry/perl/site/lib/Padre/ line 126.
    Compilation failed in require at C:/strawberry/perl/site/lib/Padre/Wx/ line 4115.
    Perl exited with active threads:
    1 running and unjoined
    0 finished and unjoined
    0 running and detached

    This is on WinXP-sp3 with Strawberry perl 5.18
    Can you help me?

  • Joel Berger commented on map/grep is not a real iterator?

    If I may self-promote, I wrote a python-esque generator module called Generator::Object, based on Coro, which may serve you if you really need lazy evaluation.

  • Toby Inkster commented on map/grep is not a real iterator?

    The input list is as much the killer as the output list is. You can test that using:

    perl -e'map{print if $_ %1000==0; ()} 1..100_000_000'

    which of course will return the empty list. The problem is that for map Perl will first build a list of the numbers 1 to 100 million as SVs, but for ($x..$y) though has been optimized in the Perl compiler.

  • Sid Burn commented on map/grep is not a real iterator?

    map/grep are no iterators at all. They just read the whole list, apply the function to every element and return a new list.

    Perl itself doesn't have special iterator support. But you still can write something as an iterator, but you have to do it on your own.

    For example you create a function that returns a function that uses an closure. Or you just use OOP for keep tracking of the current state and so on.

Subscribe to feed Responses to Comments from vsespb

About is a common blogging platform for the Perl community. Written in Perl and offering the modern features you’ve come to expect in blog platforms, the site is run by Dave Cross and Aaron Crane, with a design donated by Six Apart, Ltd.