Skip to main content

Questions tagged [perl]

Perl is a high-level, general-purpose, interpreted, dynamic programming language. It was originally developed by Larry Wall as a general-purpose Unix scripting language to make report processing easier, over a period with support from open source community, it has evolved and matured to be used for graphics programming, system administration, network programming, finance, bioinformatics, and other engineering applications.

1 vote
7 answers
313 views

Find all lines between two patterns, EXCLUSIVE of the second pattern?

Consider that I have the file listed below. I need to select all lines from every instance of the regex pattern Word A to before the regex pattern Word D. Word A Word B Word C Word D Word E Word F ...
RonJohn's user avatar
  • 1,144
0 votes
1 answer
30 views

getting started with PDL for cluster analysis PDL::Stats::Kmeans

I guess first up is the Question " is perl data language dead ?" I'm not finding any active discussions or user q&a sorry for not tagging this better I dont have the rep' my problem area ...
aldobranti's user avatar
4 votes
0 answers
47 views

Perl's `kill` is using `$! == Errno::EINTR` unexpectedly

I wrote a network daemon that forks off children to handle TCP connections. On SIGINT the main process triggers a kill for each child in order to clean up and to collect some final statistics. In ...
U. Windl's user avatar
  • 1,493
2 votes
3 answers
821 views

ARGV[] not accepting the argument

I have a shell script that I am trying to pass a date argument to ARGV[1] but the script is giving a blank output Here is the command: #!/bin/bash dt=$(date -d "yesterday" '+%m%d%Y') cat /...
NecroCoder's user avatar
4 votes
4 answers
2k views

Ist it possible to check the peer address before accepting a TCP connection?

I wrote a simple Perl server that listens on a TCP port/socket, accepting connections. Now I wonder: When wanting to implement address-based access control, is it possible to check the address of the ...
U. Windl's user avatar
  • 1,493
-2 votes
3 answers
120 views

bash + how to verify folders under specific path are ended with number/s

I want to check the folder/s under /var/kafka that all them are ended with number otherwhile I will exit with error ls -ltr /var/kafka drwxr-xr-x 399 kafka kafka 28672 Nov 9 13:10 data6 drwxr-xr-x ...
yael's user avatar
  • 13.4k
0 votes
2 answers
59 views

rename - move [ ] delimited part of filename to end of filename

I've been playing with the perl implementation of the rename tool in cygwin having finally got it working via installing from cpan. It's been a long time since i played with this stuff so I'm a bit ...
Adam B's user avatar
  • 3
2 votes
4 answers
211 views

Parse text file add semicolons before and after numbers; join all other words that are before/ between numbers with hyphens

I have a text file with accounts like: Input Sample Paid 100 15/02/2022 3000 recd 50 15/02/2022 nelur trip 3050 PAID 80 25/03/2022 Adjusted towards trip 3130 14 PAID 50 26/03/2022 Given to Nate Cash (...
tgkprog's user avatar
  • 249
0 votes
1 answer
470 views

How to remove characters from end of a line till a particular character in perl

my string is like $varin="wer.try.iuy.oiu.qert" i wanted to remove characters starting from end of the string till "." is encountered. expected output: wer.try.iuy.oiu have tried ...
Taylor_Sharma's user avatar
-1 votes
3 answers
152 views

Replace new lines at end for those lines whose 2nd field in colon separated file span over to multiple line

I have got multiple files with different set of contents but the pattern is same across mulitple lines in different files. sample input file : cat -n test.txt 1 adjfkhjdhfkjd: ...
Ashis Sahoo's user avatar
2 votes
1 answer
395 views

int seems to be not int in a used perl library

A peculiar phenomenon is on my mind. As you may know, dealing with a mail server directly exposed to the internet can be quite the 'joy' with various individuals attempting to break into it or use it ...
numchrun's user avatar
  • 508
8 votes
3 answers
988 views

Perl: change in interpretation of shell symbols in system() invocation?

Today I noticed that something changed in Perl, probably recently, in the way it runs shell commands. Could someone explain what has changed? I cannot find the answer myself and sadly we learned about ...
Kamil's user avatar
  • 1,491
0 votes
2 answers
308 views

perl: replace a string with variable containing new lines (line breaks)

I want to make edits containing meta characters. Here https://stackoverflow.com/questions/29613304/is-it-possible-to-escape-regex-metacharacters-reliably-with-sed one of solutions is via perl with s\Q ...
Martian2020's user avatar
  • 1,219
5 votes
4 answers
697 views

awk add a column if it doesn't exist

I would like to add a column 3 (description) if it does not exist in a ';' delimited file. example; #Gene;Transcripts;Description;Group gene1;G1a,G1b,G1c;gene1 is a good gene;6 gene2;G2a,G2b,G2c;gene2 ...
alex kiarie's user avatar
0 votes
1 answer
535 views

Check if two IP addresses are in a range

Using bash or perl on a minimal installed Linux, I am trying to validate two IP addresses if there are in a range. I came across a bash script that works well, but the fact that it prints all the IP ...
Bruce Malaudzi's user avatar

15 30 50 per page
1
2
3 4 5
91