IO::Async::Loop in multiple modules all loaded
2 direct replies — Read more / Contribute
|
by bliako
on Feb 13, 2026 at 18:47
|
|
|
Esteemed Minks
I have several modules which fetch data from various websockets (WS), processes it and returns back results. Fetching and processing for each websocket is different so I guess I need many Modules.
In order to fetch data from WS I use IO::Async::Loop and Net::Async::WebSocket::Client with something like this:
async sub fetch {
my $loop = IO::Async::Loop->new;
my @data;
my $client = Net::Async::WebSocket::Client->new(
on_text_frame => sub {
my ( $clientself, $frame ) = @_;
...
push @data, $frame;
# when I had enough frames
if( 10 < scalar @data ){
say "I am ".__PACKAGE__."::fetch() and we had enough data";
$clientself->close; $loop->stop;
return;
}
} # on_text_frame
);
$loop->add( $client );
await $client->connect(url => $myurl);
# tell the WS that we need data
$client->send_text_frame('send me data');
$loop->run;
my $retdata = Future->done(\@data)->get;
# save $retdata to file
...
# and return
return $retdata;
}
sub give_me_data {
# collapse the future
my $data = $self->fetch()->get();
# process data
...
return $processed_data
}
I thought that worked OK, until I needed more modules like the above for differrent websockets (which provide different data structures, and need different processing, hence the many modules which blackbox the fetch+process data into a give_me_data())
Now, these modules are loaded like:
# main
use ModuleA;
use ModuleB;
sub give_me_data {
# no Future here:
my $dataA = ModuleA->new()->give_me_data();
my $dataB = ModuleB->new()->give_me_data();
return ...
}
But there is a problem: $dataB is *empty* because the Loop in ModuleB thinks that we have received enough frames already and stops receiving (the check when enough frames are received is included above). But the debug message when this happens coming from ModuleB mentions ModuleA::fetch()! Note that the data returned from ModuleB is empty (whereas ModuleA returned lots of data).
1. Does the code-sketch for fetching data look OK to you? It will be difficult to provide running code but I can try if needed.
2. Can there be multiple IO::Async::Loop's each one on its own Module? (EDITAnswer: no, there is a singleton loop object, so don't use loop->run and loop->stop when you have many clients to this loop). All modules loaded but the loops activated *sequentially*. My intention is to dispense each loop when enough data is fetched and then continue to the next Module's loop (instantiate, loop and dispense) and so on. Am I stopping and dispensing the loops OK? Why does it remember ModuleA's fetch() when running ModuleB's loop?
3. If I have hit a wall, is there a simpler, possibly blocking, alternative for receiving data from websocket? (I have tried Mojo::UserAgent with some failures for some of the websockets). I do not really need non-blocking fetches because I need the total data from all modules before I proceed.
many thanks, bw bliako
|
In CygPerl, a fork failed with error "Resource temporarily unavailable"
2 direct replies — Read more / Contribute
|
by Intrepid
on Feb 10, 2026 at 22:11
|
|
|
I've experienced a strange failure with "Resource temporarily unavailable".
The hefty cascade of messages shown here, I think this is known as a "call stack"?:
Configuring R/RJ/RJBS/Dist-Zilla-6.037.tar.gz with Makefile.PL
0 main perl 1106 child_info_fork::abort: \??\C:\ix\cygwin\usr\local\lib\perl5\site_perl\5.40\x86_64-cygwin-threads\auto\Compress\Raw\Bzip2\Bzip2.dll: Loaded to different address: parent(0x3F07F0000) != child(0x4C08D0000)
Error while running PL phase: Couldn't fork(): Resource temporarily unavailable at /usr/local/share/perl5/site_perl/5.40/Capture/Tiny.pm line 242.
Capture::Tiny::_fork_exec("stderr", HASH(0xa03589cb8)) called at /usr/local/share/perl5/site_perl/5.40/Capture/Tiny.pm line 235
Capture::Tiny::_start_tee("stderr", HASH(0xa03589cb8)) called at /usr/local/share/perl5/site_perl/5.40/Capture/Tiny.pm line 364
Capture::Tiny::_capture_tee(1, 1, 1, 1, CODE(0xa02709420)) called at /usr/share/perl5/vendor_perl/5.40/CPAN/Reporter.pm line 161
CPAN::Reporter::record_command("/usr/bin/perl Makefile.PL") called at /usr/local/share/perl5/site_perl/5.40/CPAN/Distribution.pm line 2093
eval {...} called at /usr/local/share/perl5/site_perl/5.40/CPAN/Distribution.pm line 2093
CPAN::Distribution::prepare(CPAN::Distribution=HASH(0xa09c73b00)) called at /usr/local/share/perl5/site_perl/5.40/CPAN/Distribution.pm line 2217
CPAN::Distribution::make(CPAN::Distribution=HASH(0xa09c73b00)) called at /usr/local/share/perl5/site_perl/5.40/CPAN/Distribution.pm line 3676
CPAN::Distribution::test(CPAN::Distribution=HASH(0xa09c73b00)) called at /usr/local/share/perl5/site_perl/5.40/CPAN/Distribution.pm line 4167
CPAN::Distribution::install(CPAN::Distribution=HASH(0xa09c73b00)) called at /usr/local/share/perl5/site_perl/5.40/CPAN/Module.pm line 484
eval {...} called at /usr/local/share/perl5/site_perl/5.40/CPAN/Module.pm line 483
CPAN::Module::rematein(CPAN::Module=HASH(0xa09c70ce8), "install") called at /usr/local/share/perl5/site_perl/5.40/CPAN/Module.pm line 592
CPAN::Module::install(CPAN::Module=HASH(0xa09c70ce8)) called at /usr/local/share/perl5/site_perl/5.40/CPAN/Shell.pm line 1901
CPAN::Shell::rematein("CPAN::Shell", "install", "Dist::Zilla") called at /usr/local/share/perl5/site_perl/5.40/CPAN/Shell.pm line 2068
CPAN::Shell::__ANON__("CPAN::Shell", "Dist::Zilla") called at /usr/local/share/perl5/site_perl/5.40/App/Cpan.pm line 635
App::Cpan::__ANON__("Dist::Zilla") called at /usr/local/share/perl5/site_perl/5.40/App/Cpan.pm line 652
App::Cpan::_default(ARRAY(0xa00027238), HASH(0xa014d9b80)) called at /usr/local/share/perl5/site_perl/5.40/App/Cpan.pm line 536
App::Cpan::run("App::Cpan", "IO::Compress", "App::ccdiff", "Dist::Zilla") called at /usr/local/bin/cpan line 15
RJBS/Dist-Zilla-6.037.tar.gz
/usr/bin/perl Makefile.PL -- NOT OK
Stopping: 'install' failed for 'Dist::Zilla'.
I'd like to know what the good Monks think about that?
Feb 11, 2026 at 03:07 UTC
|
cpanm under PerlBrew instance chokes trying to install all these
1 direct reply — Read more / Contribute
|
by Intrepid
on Feb 09, 2026 at 13:32
|
|
|
Good Monday* Monks and Nuns. Over the weekend I sought to install the
Dist::Zilla module and of course its dependencies. Previously I had tried to create a
stack of the necessary modules using Pinto (and that's another story)
The message emitted by cpanm looks approximately like this ("approximately"
because I tidied it up in vim):
! Installing the dependencies failed:
Module 'Moose' is not installed
Module 'Config::MVP::Assembler' is not installed
Module 'Test::File::ShareDir' is not installed
Module 'MooseX::Types' is not installed
Module 'DateTime' is not installed
Module 'MooseX::Types::Perl' is not installed
Module 'Perl::PrereqScanner' is not installed
Module 'Config::MVP::Assembler::WithBundles' is not installed
Module 'Config::MVP::Reader' is not installed
Module 'Config::MVP' is not installed
Module 'CPAN::Uploader' is not installed
Module 'MooseX::Role::Parameterized' is not installed
Module 'Sub::Exporter::ForMethods' is not installed
Module 'Log::Dispatchouli' is not installed
Module 'namespace::autoclean' is not installed
Module 'Moose::Role' is not installed
Module 'File::Copy::Recursive' is not installed
Module 'MooseX::Types::Moose' is not installed
Module 'App::Cmd::Tester::CaptureExternal' is not installed
Module 'MooseX::LazyRequire' is not installed
Module 'Config::MVP::Reader::INI' is not installed
Module 'Test::Fatal' is not installed
Module 'Config::MVP::Reader::Finder' is not installed
Module 'Moose::Util::TypeConstraints' is not installed
Module 'MooseX::SetOnce' is not installed
Module 'Config::MVP::Reader::Findable::ByExtension' is not installed
Module 'Config::MVP::Section' is not installed
Module 'App::Cmd::Command::version' is not installed
Module 'App::Cmd::Tester' is not installed
Module 'App::Cmd::Setup' is not installed
! Bailing out the installation for Dist-Zilla-6.037.
cpanm was invoked like this:
cpanm -v -L ~/Repositories_Perl/Dist-Zilla --self-contained Dist::Zilla
The system has these characteristics:
{flyboi linux - 6.1.0-42-686 {LMDE 6 (faye)} i686} sys data courtesy this newly-installed CPAN module
Perl is running like this:
perl-5.42.0
Built under linux
Compiled at Aug 11 2025 15:34:31
%ENV:
PERL5LIB=""
PERLBREW_HOME="/home/somian/.perlbrew"
PERLBREW_MANPATH="/home/somian/perl5/perlbrew/perls/perl-5.42.0/man"
PERLBREW_PATH="/home/somian/perl5/perlbrew/bin:/home/somian/perl5/perlbrew/perls/perl-5.42.0/bin"
PERLBREW_PERL="perl-5.42.0"
PERLBREW_ROOT="/home/somian/perl5/perlbrew"
PERLBREW_SHELLRC_VERSION="1.02"
PERLBREW_VERSION="1.02"
PERL_CPANM_OPT="--verbose --with-recommends --with-suggests --no-man-pages --cascade-search --wget --mirror http://192.168.1.7/mincpan --mirror https://cpan.metacpan.org/"
@INC:
/home/somian/perl5/perlbrew/perls/perl-5.42.0/lib/site_perl/5.42.0/i686-linux-thread-multi-64int
/home/somian/perl5/perlbrew/perls/perl-5.42.0/lib/site_perl/5.42.0
/home/somian/perl5/perlbrew/perls/perl-5.42.0/lib/5.42.0/i686-linux-thread-multi-64int
/home/somian/perl5/perlbrew/perls/perl-5.42.0/lib/5.42.0
Feb 09, 2026 at 18:05 UTC
* Monday for many but not all of you
|
Has Pinto become broken for new installs? - bootstrapped cpanm cannot find Pinto
4 direct replies — Read more / Contribute
|
by Intrepid
on Feb 03, 2026 at 13:46
|
|
|
Hi Monks and Nuns. Here's another node that's not about perl coding per se but is instead about perl infrastructure/tool setup/installation.
Attempting to install Pinto on Linux - seeing error "! Couldn't find module or a distribution Pinto"
I am trying to bootstrap the Pinto perl module management application on a
machine running Debian Gnu/Linux. I have already had Pinto running on a different
(Cygwin Perl) system for some months, so I thought I knew my way around the setup.
But over the last two days I've repeatedly gotten the same error in the terminal when
trying to set up:
! Couldn't find module or a distribution Pinto
This error message is (obviously?) coming from cpanm, which the Pinto setup script
bootstraps. I see this error manifests when cpanm attempts to download Pinto and its dependencies from the
online repository its author had set up. That repo has the url
https://www.stratopan.com/thaljef/OpenSource/pinto-release . It looks like a network
problem, doesn't it? So when I do
$ ping -c4 stratopan.com
... I get no replies to my ping, although the domain does resolve to 138.68.43.143.
But when I point a browser at https://www.stratopan.com
I land on an active home page, although Firefox warns me about expired
certificates.
It's a lot to ask maybe, but could a reader just try it (setting up Pinto)? It's a one-line command:
$ curl -L http://getpinto.stratopan.com | bash
Very grateful thanks for applying some brain-power / knowledge to this problem I'm having. And, PS,
wouldn't it be theoretically possible to copy over all the module dependencies from my CygPerl installation
of Pinto to the Linux machine? I've looked, but I can't find a set-aside heirarchy of such modules.
Feb 03, 2026 at 18:45 UTC
|
Is distributed tracing / APM realistically possible for legacy Perl applications?
3 direct replies — Read more / Contribute
|
by ShallTear
on Feb 03, 2026 at 07:37
|
|
|
Hello PerlMonks community,
We are trying to implement distributed tracing (APM-style request tracing) for a legacy Perl application running in a microservices environment.
Our goal is limited to application tracing only:
- Create traces and spans inside the Perl application
- Export them to a tracing backend such as Jaeger, Zipkin, Tempo, or an APM platform
We do not require infrastructure metrics or logs.
We attempted to use OpenTelemetry for Perl. While we were able to create traces and spans, we could not reliably export them due to limitations in the Perl ecosystem.
Our findings so far:
- OTLP over gRPC is not supported due to lack of a stable Perl gRPC client ecosystem and no gRPC exporter in the Perl OpenTelemetry SDK.
- OTLP over HTTP (JSON) is incomplete; the Perl OTLP JSON encoder is not fully compliant.
- OTLP over HTTP (Protobuf) requires runtime .proto compilation using Google::ProtocolBuffers::Dynamic, which is not feasible or reliable in production.
- OTLP wire-format compliance cannot be achieved from Perl.
- This appears to be a language ecosystem limitation rather than a configuration issue.
We also evaluated Jaeger and Zipkin. However, they are tracing backends only and cannot generate traces or spans themselves without a supported Perl instrumentation and export mechanism.
Given this situation, I would appreciate guidance from experienced Perl users on the following questions:
- Is true distributed tracing / APM for Perl applications realistically possible today?
- Are there any community-recommended Perl modules or approaches to export traces (for example using Jaeger Thrift, Zipkin HTTP, or other non-OTLP formats)?
- Are there any platforms or vendors (open source or commercial) that successfully support Perl tracing in production?
- If Perl-level instrumentation is not practical, are proxy-based or gateway-based tracing approaches (for example using Nginx or Envoy) the recommended solution for legacy Perl applications?
- In your experience, what is the most practical and supported way to achieve observability for Perl services?
Any pointers to existing CPAN modules, real-world implementations, or alternative strategies would be greatly appreciated.
Thank you for your time and expertise.
Best regards,
ShallTear
|
Excel OLE list of comments methnods
1 direct reply — Read more / Contribute
|
by esr
on Jan 29, 2026 at 11:36
|
|
|
In Excel using OLE, one can access the threaded comments using the CommentsThreaded collection. Entries in that collection can be read with code like $comment->Text; and $comment->Delete;. Is there a list of other items that can be specified?
|
[XS] sv_setpv change in behaviour with perl-5.42.0 and later
3 direct replies — Read more / Contribute
|
by syphilis
on Jan 27, 2026 at 03:42
|
|
|
Hi,
On Windows 11, perl-5.42.0 and later, a string assignment (in XS) to an SV's PV buffer using sv_setpv can drastically reduce the value of SvLEN.
Demo:
use strict;
use warnings;
use Devel::Peek;
use Inline C =><<'EOC';
void foo(SV * buffer) {
char *data = "Hello there";
sv_setpv(buffer, data);
}
EOC
my $buffer = 'z' x 60;
Dump $buffer;
foo($buffer);
Dump $buffer;
Output, running on perl-5.42.0 and perl-5.43.7:
SV = PV(0x2352069fd80) at 0x235206db678
REFCNT = 1
FLAGS = (POK,IsCOW,pPOK)
PV = 0x2352275d050 "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
+zzzzzzzzzzzz"\0
CUR = 60
LEN = 64
COW_REFCNT = 1
SV = PV(0x2352069fd80) at 0x235206db678
REFCNT = 1
FLAGS = (POK,pPOK)
PV = 0x2352279a8a0 "Hello there"\0
CUR = 11
LEN = 16
What, if anything, should I deduce from the fact that LEN has been reduced from 64 to 16.
Has the size of the PV buffer actually been reduced ?
On perl-5.40.0 and earlier, when running the same script, LEN retains its original value (which is the behaviour that I expected) :
SV = PV(0x2076e35a3b0) at 0x2076e41b338
REFCNT = 1
FLAGS = (POK,pPOK)
PV = 0x2077084ae90 "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
+zzzzzzzzzzzz"\0
CUR = 60
LEN = 62
SV = PV(0x2076e35a3b0) at 0x2076e41b338
REFCNT = 1
FLAGS = (POK,pPOK)
PV = 0x2077084ae90 "Hello there"\0
CUR = 11
LEN = 62
Cheers, Rob
|
Strange depedency dilemma with Module::Package install
1 direct reply — Read more / Contribute
|
by Intrepid
on Jan 26, 2026 at 13:43
|
|
|
I've been trying to install a Bundle:: made on an older computer, to a newer one with a pristine perl installation. I'm running into repeated fails when I get to Module::Package and I am hoping for one or more of two things to happen: (a) just by writing out what seems to be happening I'll have a burst of enlightenment, or (b) someone reading this will provide answers that lead to success.
The system is Cygwin on Windows 11, perl version 5.40.3 ("system" perl for an up to date Cygwin).
Here's some of what I see in the terminal:
INGY/Module-Install-ManifestSkip-0.24.tar.gz
Tests succeeded but one dependency not OK (Module::Manifest::Skip)
INGY/Module-Install-ManifestSkip-0.24.tar.gz
dependencies -- NA
INGY/Module-Package-0.30.tar.gz
Has already been unwrapped into directory /cygdrive/D/var/cache/builds/CPAN/Module-Package-0.30-2
INGY/Module-Package-0.30.tar.gz
Has already been prepared
Running make for I/IN/INGY/Module-Package-0.30.tar.gz
Warning: Prerequisite 'Module::Install::ManifestSkip => 0.19' for 'INGY/Module-Package-0.30.tar.gz' failed when processing 'INGY/Module-Install-ManifestSkip-0.24.tar.gz' with 'make_test => NO one dependency not OK (Module::Manifest::Skip)'. Continuing, but chances to succeed are limited.
It's a bit unfortunate that the module names are so similar. It makes my eyes cross when I try to scan the output.
Fail point:
Fetching http://192.168.1.7/minicpan/authors/id/I/IN/INGY/Module-Install-ManifestSkip-0.24.tar.gz ... OK
Configuring Module-Install-ManifestSkip-0.24 ... Checking if your kit is complete...
Looks good
Warning: prerequisite Module::Manifest::Skip 0.18 not found.
Generating a Unix-style Makefile
Writing Makefile for Module::Install::ManifestSkip
Writing MYMETA.yml and MYMETA.json
OK
==> Found dependencies: Module::Manifest::Skip
--> Working on Module::Manifest::Skip
Fetching http://192.168.1.7/minicpan/authors/id/I/IN/INGY/Module-Manifest-Skip-0.23.tar.gz ... OK
Configuring Module-Manifest-Skip-0.23 ... Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for Module::Manifest::Skip
Writing MYMETA.yml and MYMETA.json
OK
Building and testing Module-Manifest-Skip-0.23 ... FAIL
Testing Module-Manifest-Skip-0.23 failed.
Here's a portion of the graphical YAML metadata for the package that seems uninstallable, Module::Manifest::Skip, that is causing failure to install Module::Package (generated by: cpanm --scandeps --format=yaml Module::Install::ManifestSkip):
---
-
- cpanid: INGY
cpanmeta: !!perl/hash:CPAN::Meta
abstract: Generate a MANIFEST.SKIP file
author:
- 'Ingy dt Net <ingy@cpan.org>'
dynamic_config: 0
generated_by: 'Dist::Zilla version 5.019, CPAN::Meta::Converter version 2.132830, CPAN::Meta::Converter version 2.150005'
license:
- perl_5
meta-spec:
url: http://search.cpan.org/perldoc?CPAN::Meta::Spec
version: 2
name: Module-Install-ManifestSkip
no_index:
directory:
- inc
- t
- xt
- example
prereqs:
configure:
requires:
ExtUtils::MakeMaker: 6.30
develop:
requires:
Test::Pod: 1.41
runtime:
requires:
Module::Install: 1.10
Module::Manifest::Skip: 0.18
perl: v5.8.1
Jan 26, 2026 at 18:41 UTC
A just machine to make big decisions
Programmed by fellows (and gals) with compassion and vision
We'll be clean when their work is done
We'll be eternally free yes, and eternally young
Donald Fagen —> I.G.Y.
(Slightly modified for inclusiveness)
|
Strange behavior of array in scalar context
3 direct replies — Read more / Contribute
|
by xavier8854
on Jan 26, 2026 at 05:13
|
|
|
Hi,
Why does scalar(@array) return 1 for an empty array ?
Code :
my @executions = $jobInfo->{'content'}{'executions'};
print Dumper (@executions, scalar(@executions));
result is :
$VAR1 = [];
$VAR2 = 1;
I use this syntax regulary, never happened.
Thanks for your wisdom,
FTR, this is perl 5.38.2 on Ubuntu 22.0.4
Xavier
|
Converting a curl cli to perl with curl2perl gives me pain
1 direct reply — Read more / Contribute
|
by bliako
on Jan 23, 2026 at 13:43
|
|
|
It has been some time since I last used curl2perl (via Corion's HTTP::Request::FromCurl) and I remember it was working perfectly. Now, v0.55, it seems counter-intuitive how the curl's command-line parameters are passed. For example, how to convert this curl command coming out of FF developer tools?:
curl 'https://example.com' -H 'User-Agent: Mozilla/5.0 (X11;)' -H 'Accept: application/json, text/plain, */*' -H 'Accept-Language: en-GB,en;q=0.5'
I tried:
curl2perl 'https://example.com' -H 'User-Agent: Mozilla/5.0 (X11;)' -H 'Accept: application/json, text/plain, */*' -H 'Accept-Language: en-GB,en;q=0.5'
I gives me usage, confused by -H. Ok then let's add all that follows the url into double quotes:
curl2perl 'https://example.com' "-H 'User-Agent: Mozilla/5.0 (X11;)' -H 'Accept: application/json, text/plain, */*' -H 'Accept-Language: en-GB,en;q=0.5'"
It thinks all headers are part of the first -H:
## Please see file perltidy.ERR
my $ua = LWP::UserAgent->new('send_te' => '0');
my $r = HTTP::Request->new(
'GET' => 'https://example.com/',
[
'Accept' => '*/*',
'User-Agent' => 'curl/7.55.1',
''User-Agent' => 'Mozilla/5.0 (X11;)' -H 'Accept: applicat
+ion/json, text/plain, */*' -H 'Accept-Language: en-GB,en;q=0.5''
],
);
my $res = $ua->request( $r, );
Changing quotes from single to double and vice-versa gives same result.
What sort of works is when each curl parameter is quoted:
curl2perl 'https://example.com' "-H 'User-Agent: Mozilla/5.0 (X11;)'" "-H 'Accept: application/json, text/plain, */*'" "-H 'Accept-Language: en-GB,en;q=0.5'"
which gives this, notice the extraneous single-quotes:
my $ua = LWP::UserAgent->new('send_te' => '0');
my $r = HTTP::Request->new(
'GET' => 'https://example.com/',
[
'Accept' => '*/*',
'User-Agent' => 'curl/7.55.1',
''Accept' => 'application/json, text/plain, */*'',
''Accept-Language' => 'en-GB,en;q=0.5'',
''User-Agent' => 'Mozilla/5.0 (X11;)''
],
);
But adding all these quotes is way too much work. Plus I am sure that I used it without having to quote anything. All I had to do was to remove the curl from the beginning of the command-line. Perhaps the Getopt::Long should be removed?
What DOES WORK is diy:
use HTTP::Request::FromCurl;
print HTTP::Request::FromCurl->new(command_curl => <<'EOC')->as_snippe
+t;
curl 'http://example.com' --compressed -H 'User-Agent: myagent'
EOC
(note: when omitting curl, it complains about Can't locate object method "host_port" via package "URI::_generic" ... HTTP/Request/CurlParameters.pm line 457., I mention it just in case this mis-usage reveals something more serious.)
bonus b[au]g: request2perl is missing a use Pod::Usage;.
I hope I am doing something wrong :) or else i write my own (that's a threat hehe :))
|
|