68,319 questions
-3
votes
1
answer
123
views
Regex using qr/\Qstring\E/ vs. (map { qr/$_/ } ("\\Qstring\\E"))[0] [closed]
In an attempt to avoid switch /x for a complex regular expression, I tried to replace qr/string/ with the following expression:
(map { qr/$_/ } ("a more" . "complex regex"))[0]
As ...
-1
votes
0
answers
50
views
Virtualmin Plugin menu item not appearing in "Manage Virtual Server" sidebar
I am developing a Virtualmin plugin. But the problem is to have a link appear under the "Manage Virtual Server" category in the Virtualmin sidebar whenever the feature is enabled for a ...
Advice
0
votes
2
replies
97
views
Is it worth to receive and return references to array instead arrays in perl for performance matters?
When writing perl functions that operate on arrays I use the tail of @_ as the "array argument" and when returning I return them by value. This keep the api simple
When I write map like ...
-1
votes
0
answers
79
views
How to match ssh-keygen's "randomart" with Expect?
When trying to match the "randomart" part of ssh-keygen's output using Expect, expect() finds an empty string after the "randomart", but not the expected eof, but I don't ...
-1
votes
2
answers
149
views
CGI in Perl: how to access the original HTTP headers
A simple proxy in Perl runs as a CGI on the webserver of my ISP.
It's purpose is to forward https GET and POST to a http webserver running on my PC.
With that https works without the need of any TLS ...
2
votes
2
answers
189
views
Why is the position of `[:space:]` within a character class seemingly important?
I'd like to use constants to build regular expressions. However, in this case I got an unexpected syntax error:
#!/usr/bin/perl
use strict;
use warnings;
use constant CR_SAFE => '[:alnum:]@,._\-...
1
vote
2
answers
136
views
TLS in Perl REST request
This curl command works fine (must be accessed in tls 1.3):
curl -v --tlsv1.3 -u "xxxx":"xxx" -X POST "https:xxxxxxx"
Try to get the same result with Perl. Created a ...
Best practices
0
votes
6
replies
106
views
Prototype mismatch importing symbols
I get a "Prototype mismatch" warning in code that either imports 'blessed' from Scalar::Util or defines it depending on the version of Scalar::Util. Is there a way to suppress the warning, ...
2
votes
2
answers
146
views
Troubleshooting: A single regular expression matching nested braces usable for java and perl
I have a regular expression in an extension of java by florian ingerl
to parse a latex command,
\\\\DocumentMetadata(?<docMetadata>\\{(?:[^{}]|(?'docMetadata'))*\\})
but the important thing is ...
0
votes
0
answers
141
views
Benchmarking Perl's Net::Async::FastCGI app consistently return LOTS of "Non-2xx responses"
Seeking community wisdom on why the ApacheBench utility consistently returns a lot of "Non-2xx responses" ( 502 Bad Gateway ) when running a benchmark test of my helloworld web app using ...
0
votes
2
answers
145
views
How to execute code in response to uncaught exceptions
In some perl code I'm evaluating $v1 $op $v2 to make sure the result is valid and the program does not abort.
However when $op eq '/' and $v2 == 0 I noticed that a user-defined die handler is called (...
-6
votes
1
answer
106
views
Why does OpenAPI output validation fail for an endpoint but not for others?
I want to create an asynchronuous OpenAPI interface. Async jobs return a 202 and a location header to query later.
This is my OpenAPI document:
---
components:
headers:
JobLocation:
...
Tooling
3
votes
5
replies
124
views
Why is this proxied Mojolicious request much much slower than directly accessing the upstream server?
I am trying to implement a Mojolicious application that (also) acts as a proxy in front or rclone serve.
To that purpose I am trying to get Mojolicious to act as a proxy, and request from rclone serve ...
Advice
2
votes
7
replies
191
views
Perl library to create static HTML
Long story short I have written my own custom HTML template system that I am very happy with. However I have done that with manually concatenating HTML tags, and it is a bit messy. There has to be a ...
3
votes
2
answers
229
views
Is `use source::encoding "ascii";` implied by `use v5.42;`?
According to the new source::encoding pragma's documentation,
use source::encoding 'ascii' is automatically enabled within the lexical scope of a use v5.41.0 or higher.
To me, this means that
use v5....