X11::GUITest and Umlauts
1 direct reply — Read more / Contribute
|
by LanX
on Oct 16, 2025 at 20:04
|
|
|
Hi
OS=Linux
I'm struggling to send special characters like umlauts ("äöüÄÖÜ") via X11::GUITest and SendKeys() to another
application.
Is there a trick I am missing? Anything after the first special character is discarded.
If I try the linux tool xte from the package 'xautomation', it works fine from the console:
gnome-text-editor & sleep 1; xte "str äöüÄÖÜß"
|
How do I build perl on Windows such that all "handshake" checks are avoided ?
3 direct replies — Read more / Contribute
|
by syphilis
on Oct 12, 2025 at 23:27
|
|
|
Hi,
I've often wondered whether, on Windows, *every* script that dies with a "handshake" error would actually have misbehaved if it had been allowed to continue.
If I had a build of perl that was identical, except that all "handshake" checks were avoided, then I'd be able to know ... and hence the question in the title.
(I'm fairly familiar with building perl on windows - no problems there. It's just a question of how to have a perl that doesn't run any of those pesky "handshake" checks.)
TBC, these "handshake" checks are the ones that result (upon failure) in the script aborting with a diagnostic of something like:
fu.c: loadable library and perl binaries are mismatched (got first handshake key 0000000012e00080, needed 0000000012d00080)
AFTERTHOUGHT:
I suppose I don't really need to avoid them. Just making them "non-fatal on failure" might suffice.
Maybe having them emit warnings, as opposed to actually croaking, might suffice.
However, it would also be nice to avoid having to hack the perl source.
Cheers, Rob
|
Weird performance issue with Strawberries and Inline::C
5 direct replies — Read more / Contribute
|
by Anonymous Monk
on Oct 12, 2025 at 15:06
|
|
|
2 C functions below differ in a single line marked with 3 stars. I thought that a modern decent compiler won't notice. I'm afraid I'm not qualified to analyse compiler flags differences. It's Win10, and 5.32 set-up long ago and portable 5.42 (PDL-edition) unpacked just now. (The code is about PWC-342-2, it's irrelevant and doesn't matter if it still returns valid answers after reduction to SSCCE). Have compiler optimisation settings been changed, in recent Strawberries, in what looks like wrong direction? (+ some more strange issues, but I'd better stay focused on this one)
use strict;
use warnings;
use feature 'say';
use Benchmark 'cmpthese';
use constant L => 1e5;
my $str = '1' x L;
substr $str, rand L, 1 , '0' for 1 .. L;
use Inline C => << 'END_OF_C';
int test_c_3( SV* str ) {
int i, tmp, acc, max;
STRLEN len;
char* buf = SvPVbyte( str, len );
len --;
acc = 0;
max = -2;
for( i = 0; i < len; i ++ ) {
acc += ( buf[ i ] == '1' ); // ***
tmp = i - 2 * acc;
if ( tmp > max ) max = tmp;
}
return max + acc + ( buf[ len ] == '1' ) + 1;
}
int test_c_4( SV* str ) {
int i, tmp, acc, max;
STRLEN len;
char* buf = SvPVbyte( str, len );
len --;
acc = 0;
max = -2;
for( i = 0; i < len; i ++ ) {
if ( buf[ i ] == '1' ) acc ++; // ***
tmp = i - 2 * acc;
if ( tmp > max ) max = tmp;
}
return max + acc + ( buf[ len ] == '1' ) + 1;
}
END_OF_C
say $^V;
say 'String length: ', L;
cmpthese -2, {
c3 => sub { test_c_3( $str )},
c4 => sub { test_c_4( $str )},
};
__END__
v5.32.1
String length: 100000
Rate c4 c3
c4 8800/s -- -0%
c3 8817/s 0% --
v5.42.0
String length: 100000
Rate c4 c3
c4 2511/s -- -71%
c3 8755/s 249% --
|
Test failures prevent installation of Module::Package::RDF (on CygPerl) ('Dependency Hell')
2 direct replies — Read more / Contribute
|
by Intrepid
on Oct 12, 2025 at 14:37
|
|
|
Here we go again, a pretty little problem with installing a CPAN module that I want to be on my system. The failure is with Module::Manifest::Skip, its tests won't get past the compile stage. The relevant message as appears below is Can't locate object method "_install_subs" via package "Module::Manifest::Skip". The failure was thrown at /usr/share/perl5/vendor_perl/5.40/Moo.pm line 49, so I updated Moo to release 2.005005 but that didn't solve the problem.
My system has these characteristics:
/usr/bin/perl v5.40.3
MS Windows 11
CYGWIN_NT-10.0-26100 3.6.4-1.x86_64 2025-07-15 07:55 UTC x86_64 Cygwin
@INC:
/usr/local/lib/perl5/site_perl/5.40/x86_64-cygwin-threads
/usr/local/share/perl5/site_perl/5.40
/usr/lib/perl5/vendor_perl/5.40/x86_64-cygwin-threads
/usr/share/perl5/vendor_perl/5.40
/usr/lib/perl5/5.40/x86_64-cygwin-threads
/usr/share/perl5/5.40
The following console output is a bit redundant but I wanted to be thorough:
Oct 12, 2025 at 18:37 UTC
|
WIn32::OLE debug
2 direct replies — Read more / Contribute
|
by Anonymous Monk
on Oct 11, 2025 at 08:41
|
|
|
I have the following code, which WORKS for a word file, but crashes for a similar word file (both docx)
use strict;
use Excel::Writer::XLSX;
use Spreadsheet::ParseXLSX;
use Carp qw( croak );
use Cwd qw( abs_path );
use Path::Class;
use Win32::OLE qw(in);
use Win32::OLE::Const 'Microsoft Word';
...
my $path=....;
my $word =Win32::OLE->new('Word.Application','Quit');
my $word_file = file(abs_path($path));
my $doc = $word->{Documents}->Open("$word_file");
print "after doc\n";
my $tables = $word->ActiveDocument->{Tables};
for my $table (in $tables) {
my $numrows=$table->Rows->Count;
$main::numcols=$table->Columns->Count;
# Iterate through rows and count columns
foreach my $rownum (1 .. $table->Rows->Count) {
my $row = $table->Rows->Item($rownum);# code crashes here
...
}
}
The code crashes as indicated with the message
Win32::OLE(0.1712) error 0x8002000e: "Invalid number of parameters"
in METHOD/PROPERTYGET "Item" at C:/Strawberry/perl/lib/Devel/ptkdb.pm line 2658.
When I try to debug with ptkdb it crashes as soon as I ask for a listing of $doc or $table
How do I go about debugging this??
|
Trouble writing a simple tracer using the DB package (loops endlessly)
1 direct reply — Read more / Contribute
|
by clueless newbie
on Oct 10, 2025 at 11:18
|
|
|
Greeting Monks,
I’m experimenting with using the built-in `DB` package to build a lightweight call tracer. I’ve previously done something similar using **Hook::LexWrap** and **Module::Info**, but this time I’d like to catch **entry and exit** events for subroutines directly through Perl’s built-in debugging interface.
Here’s the minimal prototype I’ve tried:
+
package Devel::Lite;
use strict;
use warnings;
use Time::HiRes ();
our $IN_TRACE = 0;
sub DB::sub {
return &$DB::sub(@_) if $IN_TRACE;
local $IN_TRACE = 1;
my $sub = $DB::sub;
my @args = @_;
print STDERR ">> entering $sub\n";
my @ret;
eval { @ret = &$sub(@args); };
print STDERR "<< leaving $sub\n";
die $@ if $@;
return wantarray ? @ret : $ret[0];
}
1;
Then I run it like this:
perl -I. -d:TobyLite -e "sub x { print qq{okay\n}; } x();"
…but it loops endlessly and never reaches my test sub.
If I insert a print inside the loop, I see repeated `"Time::HiRes::time"`, suggesting recursion into the debugger hook itself.
I’ve tried things like skipping `Devel::Lite` and `Time::HiRes` calls explicitly, and guarding with `$IN_TRACE`, but the loop persists.
What I’d like to understand is:
1. Why is `DB::sub` being triggered recursively despite the guard?
2. What’s the correct minimal pattern for tracing sub entry/exit safely?
3. Bonus: how best to distinguish user code from CPAN/core subs to keep the trace clean?
Environment:
This is perl 5.38.x built for MSWin32-x64-multi-thread
Running on Windows 10.
Any insight or examples would be appreciated — I’m not trying to build a full debugger, just a simple tracer that logs the call tree.
TIA
PS: So far this has stumped (in no order) ChatGPT, claude, and Gemini.
|
Are beheaded strings known to be slow?
3 direct replies — Read more / Contribute
|
by Anonymous Monk
on Oct 09, 2025 at 13:57
|
|
|
I know Perl maintains a pointer (offset), within an SV, of where actual data in PV buffer starts, -- is this "beheading" the reason for the slowdown as demonstrated?
use strict;
use warnings;
use Benchmark 'cmpthese';
my $str = ' ' x 1e5;
sub test1 {
my $s = shift;
my $copy = substr $str, 1;
1 while $copy =~ /./g;
_:
}
sub test2 {
my $s = shift;
substr $s, 0, 1, '';
1 while $s =~ /./g;
_:
}
cmpthese -1, {
test1 => sub { test1( $str )},
test2 => sub { test2( $str )},
};
# (warning: too few iterations for a reliable count)
# Rate test2 test1
# test2 2.79/s -- -93%
# test1 41.0/s 1372% --
|
What do I use for the callback function in Net::LDAP::Control::Paged?
1 direct reply — Read more / Contribute
|
by adamsj
on Oct 07, 2025 at 16:20
|
|
|
|
|
CygPerl question: what to expect from update when Cygwin releases 5.42
1 direct reply — Read more / Contribute
|
by Intrepid
on Oct 06, 2025 at 13:44
|
|
|
Hello perMonks and perlNuns.
As my Subject indicates, I am thinking ahead to when the cygwin project upgrades
Perl to 5.42. What I am asking isn't about the Perl language but rather about
systems administration. I got badly burned by doing something ignorant awhile back,
as discussed weeks ago in Nooo!... Have I trashed my Strawberry?.
When I update using cygwin setup.exe, I think I remember that the core language modules will
not update, but rather are updated as a separate package from cygwin.com (is this right?).
And what about the vendor modules? But mostly, what about the modules in site_perl
locations, modules I've built and installed myself? I think one answer will be
to autobundle using cpan, but there are other possible solutions. Any advice would
be welcomed.
CygwinPerl on my system:
$ /usr/bin/perl -le 'print $^V'
v5.40.3
My @INC looks like this:
$ perl -le 'print for @INC'
/usr/local/lib/perl5/site_perl/5.40/x86_64-cygwin-threads
/usr/local/share/perl5/site_perl/5.40
/usr/lib/perl5/vendor_perl/5.40/x86_64-cygwin-threads
/usr/share/perl5/vendor_perl/5.40
/usr/lib/perl5/5.40/x86_64-cygwin-threads
/usr/share/perl5/5.40
So when one autobundles, are modules selected from all dirs in @INC or only from
the site_perl dirs, which are in my case (and presumably in all CygwinPerl users cases):
/usr/local/lib/perl5/site_perl/5.40/x86_64-cygwin-threads
/usr/local/share/perl5/site_perl/5.40
Or does autobundle select everything, including core modules and vendor modules? If it
does, I want a better solution.
Answers I got to that posting about trashing StrawberryPerl included this notable
one: Re: Nooo!... Have I trashed my Strawberry?. I am going to look
into the recommended UrBackup while I am awaiting advice here.
Oct 06, 2025 at 17:34 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)
|
Help taking over maintainership of a CPAN module
1 direct reply — Read more / Contribute
|
by MADS
on Oct 06, 2025 at 07:40
|
|
|
Hello
I’m seeking help and guidance regarding taking over maintainership of a CPAN module. I’ve been in contact with the current maintainer, and the module is no longer maintained and has stopped working due to code drift. The original maintainer has given me written consent to take over the module. However, there’s a problem — his CPAN account is registered under his old university email address, which he no longer has access to. Because of this, he can’t confirm the transfer through the usual channels.
I’ve already emailed the PAUSE administrators for assistance but haven’t received a response yet.
Does anyone have any suggestions on how to proceed?
Regards
|