Skip to main content

Questions tagged [perl]

Perl is a language optimized for scanning arbitrary text files, extracting information from those text files, and printing reports.

Filter by
Sorted by
Tagged with
2 votes
0 answers
77 views

zoxide is a replacement for cd that allows fuzzy matching against commonly accessed directories (e.g., ...
404 Name Not Found's user avatar
6 votes
1 answer
111 views

The following function searches for disks whose partitions all have an attribute that match a filter when listed with lsblk. Comments are in TomDoc format. ...
mikeLundquist's user avatar
4 votes
1 answer
104 views

The following function filters and formats /etc/fstab for future use. Comments are in TomDoc format. ...
mikeLundquist's user avatar
5 votes
1 answer
539 views

I often find myself working with files I get from other users that mostly work on Windows machines (I, myself, am on a macOS) and they tend to name their files in all sorts of (weird & difficult ...
baduker's user avatar
  • 1,378
6 votes
2 answers
783 views

My work has an isolated network that developers write applications to run inside of. These developers often write Python code. This Python code often requires modules from the Python Package Index (...
Erin S.'s user avatar
  • 63
5 votes
1 answer
190 views

This is an ongoing project that has undergone a major update to speed up list processing. Here is the homepage for anyone interested. It processes lists defined in ...
T145's user avatar
  • 3,159
5 votes
0 answers
210 views

I have this Perl module project. My implementation of the Dijkstra's algorithm follows: ...
coderodde's user avatar
  • 32.3k
5 votes
1 answer
108 views

This is my very first data structure written in Perl for a d-ary heap: ...
coderodde's user avatar
  • 32.3k
4 votes
2 answers
169 views

I have this program for tagging directories and switching between the folders via tags. The front end is written in Bash (version 4.4.23) and the back end in Perl (5.26.1). Critique request Since this ...
coderodde's user avatar
  • 32.3k
7 votes
1 answer
800 views

I am using the following one-liner to remove duplicate non-empty lines without sorting: perl -ne 'if ( /^\s*$/ ) { print } else { print if ! $x{$_}++}' Empty (...
Ahmad Ismail's user avatar
5 votes
1 answer
501 views

Description This script takes any domain input from STDIN and converts unicode domains into punycode. Features Any domains that throw an error get ignored. When fed any ASCII domains, they just pass ...
T145's user avatar
  • 3,159
3 votes
2 answers
206 views

I am trying to make a DDoS code, and here's what I have so far. I am trying to make it more efficient and powerful, just for testing purposes. I'm new, and I was wondering if I could do that. Is ...
zAndrewi's user avatar
8 votes
1 answer
380 views

I have written a script which does parsing to the input file and take out some values from them with respect to the node and print the data accordingly. Below is my script, and it works as expected: <...
vkk05's user avatar
  • 183
9 votes
1 answer
347 views

I wanted to make a script that would parse a main file (with int main()) look in its #include "..." local headers, and ...
milanHrabos's user avatar
12 votes
4 answers
3k views

I wrote a simple transpiler (that may be a bit of a stretch) in perl to cut down on some boiler plate code. I'm very new to perl, this being maybe my third ever project in it. My main question would ...
Shipof123's user avatar
  • 353
2 votes
3 answers
172 views

I've decided to work on my Perl skills. I've written a small subroutine that splits a string based on an optional delimiter. I'd like any feedback on this program so I can kick bad habits to the curb. ...
Ben A's user avatar
  • 10.8k
7 votes
1 answer
209 views

I know I never have to reinvent the wheel, but I did because I need speed performance. Also, I need these features: introspection or metaprogramming actuate like API backend private variables ...
The nothing's user avatar
5 votes
2 answers
518 views

I had a 50 GB text file (about 45 million lines) and needed to extract about 1500 lines from it. I knew their indices, that is, line numbers. Those 1500 lines were spread across the whole file up to ...
Alexander's user avatar
  • 257
3 votes
1 answer
69 views

I had another question for my Perl class assignment. Related question: Frequency analysis for simultaneous dice rolls ...
alec's user avatar
  • 131
9 votes
1 answer
158 views

My professor told me to optimize my perl code, but he wouldn't tell me what exactly - just make it simpler. I changed some little things but nothing major. Am I missing something? The task was: ...
alec's user avatar
  • 131
7 votes
1 answer
143 views

I took a lot of pictures with my camera and I wanted to make a time-lapse out of them. The camera saved the pictures as picture1, ...
Zwettekop's user avatar
  • 125
6 votes
1 answer
156 views

Extract the strings from nested arrays in Perl. It prints: a, b, c, d, E ...
Miroslav Popov's user avatar
8 votes
1 answer
282 views

As I explain in my rant, I have been searching for a replacement to hand-crafted POSIX-make-compatible makefiles to manage my dotfiles (which use symlinks). I ...
D. Ben Knoble's user avatar
9 votes
2 answers
3k views

Here is my bash script that I just wrote to count line of code for JavaScript project. It will list number of: Comment lines Blank lines All lines Here is my script: ...
Chau Giang's user avatar
8 votes
1 answer
185 views

Although UTF-8 validation is a common task, I'm trying to solve a slightly different task; given a string of bytes, work out whether it could potentially be a fragment of a valid UTF-8 string. That's ...
ais523's user avatar
  • 181
7 votes
1 answer
182 views

Here is the working code (intended to be executed with perl -e '<code>' ~/.ssh/config): Actual version: ...
GrandOpener's user avatar
12 votes
2 answers
302 views

I've been using this wgs84togrid program for a few years. It converts in both directions between National Grid coordinates for GB or Ireland (beginning with a ...
Toby Speight's user avatar
  • 88.7k
5 votes
1 answer
231 views

I'd like to optimize my code and get a better understanding of how I can perform the task I am doing better. I've only used Perl threads about 3 or 4 times now. The purpose of my code block is to ...
falconspy's user avatar
  • 151
5 votes
1 answer
968 views

I use bash scripts to process last names through a Perl program, and I parallelize the execution like this, by name initials: ...
dmc7z's user avatar
  • 159
4 votes
1 answer
344 views

I have made this program to simulate polybar's bspwm module. So far, it works flawlessly; however, it consumes too much RAM and CPU (16-30%). I suspect it is the <...
user9111001's user avatar
10 votes
4 answers
483 views

I have ack (the searching tool) "installed" as a single file at C:\ack\bin\ack.pl on a Windows 10 machine and was ...
Greg Nisbet's user avatar
8 votes
1 answer
180 views

I wrote a Perl script to import local files with "File-Ending-Versioning" (like file.1.12.pm) into a Git repository. I tried to use the concept of roles ...
yulivee's user avatar
  • 181
5 votes
2 answers
154 views

I refactored some of my code: Summary: This implementation works with PSGI/Plack. It gets the URL from $env->{PATH_INFO} and assigns a different variable ...
The nothing's user avatar
9 votes
2 answers
204 views

I have a script for parsing BAM files. The script's input thus is lines like ...
Randoms's user avatar
  • 193
7 votes
2 answers
318 views

First time poster, be gentle. I wanted something similar to Mojo::Promise->all, except with an option to discard certain rejected (or, I guess, resolved) promises dependent on rejection value, as ...
robut's user avatar
  • 173
6 votes
1 answer
405 views

This is my first go at a Perl script to (semi-) automate setting the correct IP settings. I use it to configure a virtual machine after creation. It's also my first Perl script as a whole, so I'm ...
Fang's user avatar
  • 617
7 votes
1 answer
174 views

Motivated by this question, I created a simple benchmark for investigating what is the fastest way to extract a substring given two delimiting words: ...
Håkon Hægland's user avatar
10 votes
1 answer
181 views

I'm working on 2-D top-down graphics engine, and need a way to simulate clouds. My idea was that I could create a layer comprised of a matrix of rectangles whose alpha value would be picked from a ...
Bee H.'s user avatar
  • 265
9 votes
1 answer
488 views

Intro Finally had the time to do some wargames again, but I have come to the point where I need to build my own test enviroment to test certain ideas, because I can't test it online. The current ...
Ludisposed's user avatar
  • 11.8k
8 votes
1 answer
147 views

I have some code that I wrote for a personal project which takes, as arguments, a directory and a URL. It then processes the files in the named directory, archives them, and uploads the archive to the ...
Jonathan Dewein's user avatar
5 votes
1 answer
317 views

I have some subroutines which I commonly copy & paste into much of my work. I recently posted this on StackOverflow and user simbabque suggested that I post my code here for reviews and comments: ...
con's user avatar
  • 361
5 votes
2 answers
163 views

Sometimes, I'm reviewing old questions written in Python2, with no parentheses around print statements. Or I'm changing one of my older codes, also without ...
Ludisposed's user avatar
  • 11.8k
25 votes
4 answers
3k views

In a different post I showed the following Perl CGI script. Someone in the comments said that "You're using a lot of very unperlish syntax, and I'd like to give you some feedback". So, ...
amblabs's user avatar
  • 351
8 votes
2 answers
525 views

I'm trying to improve my Perl and am doing some wargames online. I wrote a small utility to help me pass a stage. The main weakness of a simple substitution cipher is repeated use of a simple key. ...
Ludisposed's user avatar
  • 11.8k
11 votes
1 answer
249 views

I've posted a few questions about natas a wargame. But I'm stuck at natas29 it has to do with Perl. I've never coded in Perl before. Thus to help me beat the last few levels, I decided it is time to ...
Ludisposed's user avatar
  • 11.8k
6 votes
3 answers
4k views

The below code removes empty line from test.txt. I posted this answer on StackOverflow but someone commented that this code needs review and suggested me to post ...
Bala Krishnan's user avatar
4 votes
2 answers
433 views

I have a Fasta file which I am opening and reading. I need to search for certain regions of the DNA sequence and, for each match found, print the sequence header followed by all matches within that ...
Sammi's user avatar
  • 41
9 votes
2 answers
739 views

I am newbie in Perl programming and currently trying to use Net::OpenSSH module in my code. My code as below which the task is to run multiple commands in remote server: ...
MrAZ's user avatar
  • 191
10 votes
2 answers
7k views

Explanation I'm trying to get better unit test coverage of my server. I needed to mock out some system libraries (I could not find anything that worked easily for C++). Because I did not want to do ...
Loki Astari's user avatar
  • 97.7k
5 votes
2 answers
150 views

I am very new to perl. So far I love it, my new favorite interpreted language. I am quickly learning that perl has MANY 'tricks' to it. The following code extracts file names out of one array and into ...
Dellowar's user avatar
  • 267

1
2 3 4 5