Skip to main content
Filter by
Sorted by
Tagged with
-2 votes
1 answer
44 views

I have a script that starts like this: use strict; use feature 'say'; use warnings FATAL => 'all'; use autodie ':default'; use Term::ANSIColor; use Cwd 'getcwd'; use SimpleFlow qw(task say2); use ...
con's user avatar
  • 6,243
Advice
2 votes
2 replies
100 views

I am sure there is some "Perl magic" that makes my code much shorter. my %m = ("a" => 1, "b" => 12, "c" => "33"); my $str = ""; for ...
chris01's user avatar
  • 12.8k
Advice
1 vote
2 replies
99 views

I have a maximum number and a separator - e.g., max. of 7 and "," for separator. I want a string from 0 to this max with a separator. my $str = foo (7, ","); # $str should be "...
chris01's user avatar
  • 12.8k
1 vote
0 answers
84 views

I've written a Perl script where I am able to successfully use the parallel::forkmanager module. I setup a simple script which has 6 entries in an array and takes 3 at a time, just prints the number ...
user1475463's user avatar
Best practices
0 votes
10 replies
141 views

Web search somehow do not find relevant results. And perl docs too (e.g. seems there is no 'selection operator'). I have a large text file and want output of results of global substitution, but not ...
Alex Martian's user avatar
  • 3,930
4 votes
2 answers
101 views

In Perl on Linux, I want to check the File status flags of an OS file descriptor number without knowing which Perl file handles, if any, use that file descriptor (the fd might even have been inherited ...
jimav's user avatar
  • 938
-1 votes
0 answers
49 views

I'm working on a SpamAssassin plugin, which would submit the text of a suspected email to AI (via HTTP POST) and process the response. The response is expected to contain a one-word verdict (one of &...
Mikhail T.'s user avatar
  • 4,340
1 vote
1 answer
115 views

I'm working on a little wikilink to Markdown link converter with Perl. This is the conversion code: foreach my $idx (0 .. $args) { if (-e -f -r -w $ARGV[$idx]) { my $file_name = $ARGV[$idx]; ...
Cyncrovee's user avatar
Best practices
2 votes
6 replies
83 views

Which the best way for deploying an Perl Mojolicious web app to an containerized production environment like Docker or Kubernets: # one process per pod /script/my_app daemon or starting an more ...
Dragos Trif's user avatar
-2 votes
1 answer
91 views

Trying to write some Perl code, wherein a hash reference is defined and some functions that can work with that hash reference. The following code works package test { sub run { my $...
mskcc's user avatar
  • 5
4 votes
4 answers
228 views

I would like to use a Perl one-liner to modify numeric values in a text file. My data are stored in a text file: 0, 0, (1.263566e+02, -5.062154e+02) 0, 1, (1.069488e+02, -1.636887e+02) 0, 2, (-2....
mabalenk's user avatar
  • 1,095
2 votes
2 answers
88 views

In Perl under Unix (HP-UX and Linux) I start instances of a program and redirect their outputs to files. I fork without problem, close the old STDOUT and STDERR, open a file to use as STDOUT, then ...
Kzwix's user avatar
  • 315
3 votes
1 answer
67 views

I've gone through the Custom Data Labels documentation carefully, and reduced down to a simple example: #!/usr/bin/perl use strict; use warnings; use Excel::Writer::XLSX; my $workbook = Excel::...
SSilk's user avatar
  • 2,604
1 vote
3 answers
200 views

I have the following program with JSON: use strict; use warnings; use Data::Dumper qw( ); use JSON qw( ); my $json_text = '[ { "sent": "2026-01-16T17:00:00Z", "...
Jindra fucik's user avatar
0 votes
1 answer
149 views

In a script I'm using constants (use constant ...) to allow re-use ion actual regular expressions, using the pattern from https://stackoverflow.com/a/69379743/6607497. However when using a {...} ...
U. Windl's user avatar
  • 4,866

15 30 50 per page
1
2 3 4 5
4555