Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

The Monastery Gates

( [id://131]=superdoc: print w/replies, xml ) Need Help??

New here?I want to ask a question of the Perl Monks. Where do I start?

Notices:

hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.

If you're new here, please read PerlMonks FAQ
and Create a new user!

Quests
poll ideas quest 2025
Starts at: Jan 01, 2025 at 00:00
Ends at: Dec 31, 2025 at 23:59
Current Status: Active
3 replies by pollsters
    First, read How do I create a Poll?. Then suggest your poll here. Complete ideas are more likely to be used.

    Note that links may be used in choices but not in the title.

Perl News
German Perl/Raku Workshop 2026 in Berlin
on Nov 10, 2025 at 14:16
0 replies by Corion
Eskild Hustvedt on the joy of rediscovering Perl
on Oct 29, 2025 at 05:31
0 replies by mldvx4

    Eskild Hustvedt has written a nice blog entry on the joy of rediscovering Perl:

    So, since I wanted to get away from the node-ecosystem, and my static site generator was written in JS, I thought I would try my hand at writing one in Perl. This is the most fun I've had writing code for years. It's just so nice to write.

    I have to agree. While there can be utility in knowing other scripting languages, it is Perl which stands out as being a lot of fun. YMMV.

Supplications
Update Old Selenium Tests
2 direct replies — Read more / Contribute
by hbarnard
on Nov 12, 2025 at 04:38

    I have a fairly substantial, but 'old', set of tests for Cclite. They use, or used use Test::WWW::Selenium; which now doesn't seem to find a webdriver on any version of Selenium that I download

    Error requesting http://10.0.0.65:4444/selenium-server/driver/: 404 Not Found

    My tests all take the form of

    $sel->open_ok("/cgi-bin/cclite.cgi"); $sel->type_ok("registry", 'dalston'); $sel->type_ok("userLogin", $user); $sel->type_ok("userPassword", "password"); $sel->submit("form") ;

    I'd really like to find some way to use/re-use them without too much extra work. I'm prepared to do a little Java and recompile Selenium if it comes to that

Can I (with XS) invoke the regex engine without making copies of the buffer?
1 direct reply — Read more / Contribute
by NERDVANA
on Nov 09, 2025 at 13:36
    This is related to my module Crypt::SecretBuffer, where the goal of the module is to prevent leaking secrets into the freed heap memory of the perl process where something could later come along and scan the address space looking for leftover secrets. The SecretBuffer tries to isolate data from being looked at by any normal Perl ops, so that it can be exclusively be viewed by XS/C functions and wiped clean when it goes out of scope.

    So, in that context, is there any way to use "pregexec" to apply the perl regex engine to my buffer but prevent it from making copies into perl-owned buffers? pregexec seems a bit under-documented... It says "described in perlreguts" but while that has pages upon pages of the inner workings of the regex engine, it doesn't even tell the meaning of the return value of pregexec or explain exactly what the final "nosave" parameter means. Ideally it would be a flag that does exactly what I want and avoids copying any buffers into any global variables, but that doesn't seem to be the case from looking at the C code. (which I admit I haven't taken the time to fully understand yet)

    I'd also be OK if it made copies, but someone could tell me a reliable way to go zero out the buffers of those SVs so that all the captures magically appear to be full of NUL characters afterward.

    Basically I'd like it to behave like standard C library regexec that just records positions of the capture groups in an array. I'm also debating if I should just use libc's regexes and declare that limitation on the SecretBuffer API, that you have to restrict yourself to Posix extended regex notation.

    Update:

    So actually the "nosave" parameter does appear to do some of what I want. Setting that flag prevents any of the magic variables from getting updated.

    perl -e 'use v5.40; use Inline C => q{ int call_pregexec(SV *regex, SV *sv) { REGEXP *rx= SvRX(regex); STRLEN len; char *buf= SvPV(sv, len); return pregexec(rx, buf, buf+len, buf, 0, sv, 1); } }; say "098mnb" =~ /([0-9])([a-z])/; say call_pregexec(qr/([a-z])([0-9])/, "abc123"); say $&; say $1; say $2; say $+[0]; say $+[1];'

    but then, the question becomes how to find out *where* the regex matched, since it didn't update any of the output variables.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2025-11-13 05:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (68 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.