Skip to main content
Filter by
Sorted by
Tagged with
-3 votes
2 answers
180 views

I have filenames with this pattern [a-zA-Z0-9]{10} and .txt extension. They might also contain a pattern like this [super] and it could be either before or after [a-zA-Z0-9]{10} with '_' separating ...
user1850133's user avatar
  • 3,057
0 votes
2 answers
118 views

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 (...
U. Windl's user avatar
  • 4,748
-5 votes
1 answer
97 views

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: ...
Marc0's user avatar
  • 23
Tooling
3 votes
5 replies
107 views

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 ...
simone's user avatar
  • 5,262
Advice
2 votes
7 replies
175 views

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 ...
James B's user avatar
  • 53
3 votes
2 answers
215 views

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....
ikegami's user avatar
  • 391k
7 votes
1 answer
140 views

I'm running into a weird import error message while trying to create a commandline tool that references packages within a Perl web application. The web application itself is working fine. I can ...
DylanStreb's user avatar
2 votes
2 answers
110 views

When using the perl library Storable to store and retrieve XML::LibXML document objects, I get a segmentation fault. Specifically, once I use the LibXML routine findnodes. My question is: why, and is ...
cms's user avatar
  • 277
5 votes
2 answers
139 views

I know how to get all of the values of a hash given a set of keys: use strict; use warnings; use DDP; my %h = ( a => 1, b => 2 ); my @v = @h{a,b}; p @v; # ( 1, 2 ) However I'm not sure ...
Rawley Fowler's user avatar
4 votes
2 answers
140 views

I have a minimal working example of two nested while loops on the same array @g: #!/usr/bin/env perl use 5.042; no source::encoding; use warnings FATAL => 'all'; use feature 'say'; use autodie ':...
con's user avatar
  • 6,227
2 votes
2 answers
161 views

If there's a hash where one of the values is an array, what's the shortest way to split into an array-of-hashes (AoH) for each array value that keeps all the hash keys and values, except for replacing ...
Richlv's user avatar
  • 4,245
2 votes
2 answers
127 views

How can I substitute every character that is: not WORD (a-z, A-Z, 0-9) and also not minus (-) and also not hash (#) to underline (_) e.g. "aB-09 !#" => "aB-09__#" &...
chris01's user avatar
  • 12.7k
1 vote
0 answers
91 views

This package of the Perl Data Language https://metacpan.org/pod/PDL::Minuit When I run only the parameter definition part of the example program: use PDL::LiteF; use PDL::Minuit; mn_init(\&$chi2, {...
Enredanrestos's user avatar
2 votes
3 answers
175 views

Let's say I want to replace every occurrence of 12345 in file1 with the contents of file2. The following code works: use strict; use warnings; local $/; open my $fh, 'file1' or die "$!"; ...
Ivan's user avatar
  • 397
2 votes
1 answer
145 views

I would like the following code to round-trip properly on Perl ≥5.36. ❯ perl -MCpanel::JSON::XS=decode_json,encode_json -Mbuiltin=false,true -MDevel::Peek=Dump -E' say Cpanel::JSON::XS->VERSION;...
daxim's user avatar
  • 39.3k
1 vote
4 answers
249 views

To avoid some confusion and questions, I changed the new string to "letters", so it would not match "text", so to avoid infinite loops. I work under Windows, with the perl provided ...
virolino's user avatar
  • 2,331
3 votes
1 answer
104 views

While writing a new Perl module which was capable of using AnyEvent, my benchmarking tests showed that it was slowing down dramatically over time. Turning off AnyEvent cured the problem, which ...
TFBW's user avatar
  • 1,259
2 votes
3 answers
148 views

Related to Properly simulate "pattern" attribute with javascript: How do I set an input pattern using JavaScript? when I try element.pattern = 'a\S' (as a trivial example), then the pattern ...
U. Windl's user avatar
  • 4,748
-2 votes
1 answer
167 views

My task was to port debian12 to debian13. In debian13 I noticed that the website was behaving differently with Perl v5.40.1. I found out that the following line returns different values on different ...
Namal's user avatar
  • 289
-2 votes
2 answers
104 views

In a CGI script that processes arrays of strings the user can supply for each field whether to match a string there or not. If all user-specified criteria are fulfilled, the specific array should be ...
U. Windl's user avatar
  • 4,748
2 votes
1 answer
87 views

I'm defining some tests for a library I'm using. One of my tests is calling the code in such a way that it produces warnings, which is expected. However, I'd ideally like to suppress these warnings ...
plentyofcoffee's user avatar
0 votes
0 answers
80 views

I try to pack a .pl file to executable on windows, I have strawberry-perl-5.40.2.1-64bit-portable and par:packer installed, also Tk is installed. But it keep report error when execute pp -o a.exe a.pl ...
Lamp's user avatar
  • 444
0 votes
1 answer
117 views

In my quest to get to know Nix and NixOS better, I'm going to try moving a small utility I have onto my NixOS server. There are two components to this utility: A Perl script, which requires both (a) ...
kqr's user avatar
  • 15.1k
2 votes
2 answers
189 views

I want to know whether the input contains any non-space as in \S. However, the input may contain ANSI VT escape sequences (Wikipedia) for text color and style, which do match \S (even the ESC code ...
Lumi's user avatar
  • 15.5k
2 votes
2 answers
179 views

I've just come across such usage of Perl constants: use strict; use warnings; use constant PI => 4 * atan2(1, 1); print("The value of PI is: ${\PI}\n"); # The value of PI is: 3....
Eugene Yarmash's user avatar
5 votes
6 answers
519 views

I'm looking for a Perl regex that matches two or more consecutive dots unless there are three dots. These strings should match: Yes.. Please go away. I have the ball.. In this case....I vote yes. ...
ericgbirder's user avatar
1 vote
1 answer
70 views

I am creating a Bug on Bugzilla 5.2+ via rest-API. I try to achieve to set the reporter to a known Bugzilla user which differs from the used API-User. I already tried that by creating an Extension.pm ...
MSauer's user avatar
  • 168
-1 votes
2 answers
147 views

since Snowflake is switching to MFA, I need to change some perl code to use access tokens. Just doing something simple like this: my $username = ''; my $pwd =''; my $dbh = DBI->connect($dsn, ...
llamaface's user avatar
2 votes
1 answer
153 views

Consider the following Perl script: #!/usr/bin/perl foreach(split '$$', 'A$$B'){ print; } print "\n"; foreach(split '\$\$', 'A$$B'){ print; } print "\n"; Given the well-known ...
Math Rules's user avatar
-2 votes
3 answers
126 views

Original data contains 4 times repeated characters, seperated by a space. For example, code2 1 1 1 1 7 7 7 7 10 10 10 10 eq code9 a a a a tpp1 tpp1 tpp1 tpp1 es I'd like to add suffix to pairs using ...
S Lee's user avatar
  • 27
-1 votes
1 answer
68 views

The following code creates a menu list called "User Selection" with four menu items: "Save", "Save As", "Load, and "Load From": my $userselectedmenuitems = ...
Nathan Goedeke's user avatar
-2 votes
4 answers
188 views

I have a problem I don't understand: Given a string consisting of multiple lines like this: DB<5> x $token 0 'ACCOUNT_CHANGED = "20250728081545Z" ACCOUNT_CHANGED_T = "...
U. Windl's user avatar
  • 4,748
0 votes
2 answers
183 views

The DBI docs on prepare() state that it's behaviour differ for various drivers: Drivers for engines without the concept of preparing a statement will typically just store the statement in the ...
planetp's user avatar
  • 16.6k
0 votes
2 answers
132 views

This line works fine under linux : PGPASSWORD=***** psql --username=**** -h ***** -d **** -p **** -P pager=off -t --csv -c "select \"Nom\", \"Path\" from \"vVMware-Vms\&...
Denis.A's user avatar
  • 299
2 votes
2 answers
156 views

I'm trying to read a json file which contains Vietnamese text. I tried using decode_json with in-file string and it works well. use strict; use warnings; use JSON; binmode(STDOUT, ":encoding(...
minhnn's user avatar
  • 29
0 votes
1 answer
146 views

I found some old code that does this: while(<IN>) { chomp; split; if ($_[0] eq "junk") { ... } The code works presuming pre-5.12 split in void context behavior: $ /depot/perl-...
stevesliva's user avatar
  • 5,716
-1 votes
1 answer
82 views

I am having problems running commands using IPC::run with special characters, in my current case ' and * The used commands: apt-get -y --allow-unauthenticated -o Dpkg::lock::timeout=0 install /tmp/...
user31061291's user avatar
-4 votes
2 answers
140 views

I am trying to get par-packer running under Cygwin and having problems with Perl version mismatch. After installing and trying to run, I get this error: bin > pp -o ehive_decode.exe myscript.pl ...
neilw's user avatar
  • 485
-2 votes
2 answers
122 views

The manual page for the Perl gvmodule (graphviz) states: New edges Add new edge between existing nodes edge_handle gv::edge (tail_node_handle, head_node_handle); ...
U. Windl's user avatar
  • 4,748
1 vote
4 answers
227 views

When using alternation with captures, I've often been somewhat puzzled by how it actually works, in particular why I would often get void (undef) match entries which I then have to discard by ...
Lumi's user avatar
  • 15.5k
4 votes
1 answer
117 views

I wrote some program for Perl 5.26.1, using strict and warnings. So after some tests without a message I thought it's OK. But when I ran the program wth older Perl 5.18.2, I suddenly got a warning ...
U. Windl's user avatar
  • 4,748
0 votes
2 answers
131 views

A have a question similar to Perl: Testing that a file is actually writable as opposed to checking file permissions: In a program I have an option to specify a required output file, and I want to ...
U. Windl's user avatar
  • 4,748
4 votes
1 answer
258 views

I thought I'd try using mmap to search a multi-gigabyte file without running out of memory. I tested on a file that did actually fit and the File::Slurp version took less than a minute but the File::...
jhnc's user avatar
  • 18.7k
2 votes
2 answers
101 views

my $modifiers = 'i'; my $string = "abcabc\n"; $string =~ s/(?$modifiers)B/Z/; print $string; $modifiers = 'g'; $string =~ s/(?$modifiers)a/q/; print $string; The first regex works and ...
Steve Waring's user avatar
  • 3,289
-6 votes
2 answers
250 views

How can I join string content in Perl? my $string = $q->param("us1"); # this is what entered +book +dog +cat print join(',', $string), "\n"; This is the output I want: "+...
mike joe's user avatar
3 votes
3 answers
158 views

I'm trying to extract the tabular data from apache pyspark logs using a perl one-liner. Below is the sample file log and there are 3 tabular output from the spark output: 24/06/19 01:00:00 INFO org....
stack0114106's user avatar
  • 8,893
1 vote
3 answers
121 views

This statement: open(FIND, "/usr/bin/find /home/steve -type f -print |"); gives: Insecure $ENV{PATH} while running with -T switch I got around it by setting $ENV{PATH} = '/usr/bin'; but ...
Steve Waring's user avatar
  • 3,289
0 votes
3 answers
115 views

I use Perlbrew to manage local Perl binary installs. I'd like to clone the current install so that I can test out a new CPAN module, and then revert if I don't like the module. I'd rather not wait the ...
Joe Casadonte's user avatar
1 vote
2 answers
94 views

Problem shown below: use 5.036; # signatures use strictures; package Foo { use Moose; sub quux($self) { ... } } package Big::Quux { use Moose::Role; sub quux($self, $another) { ... } ...
daxim's user avatar
  • 39.3k
1 vote
1 answer
67 views

my $mw = MainWindow->new; my $text = $mw->Text->pack; $text->insert('end', 'hello world', 'mytag'); $text->deleteTextTaggedWith('mytag'); MainLoop; The deleteTextTaggedWith causes: ...
Steve Waring's user avatar
  • 3,289

1
2 3 4 5
1367