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
1 answer
11 views

Fedora 40 - Apache Perl CGI - Open for writing fails

Last week, I upgraded my Linux file server from Fedora 39 to Fedora 40, and several CGI applications written in Perl stopped working. I first noticed it when Foswiki could not show any pages, because ...
Lars Poulsen's user avatar
0 votes
1 answer
52 views

Combining multiple files by year (column in data) into one line and add file name as first column in Perl or Python

I have over 3000 files that need to be combined based on specific attributes in the files. For example, each file is named by its ID (Eg. 101567AD_Mly.txt).These IDs correspond to latitude and ...
Kaitlin DeBoer's user avatar
1 vote
3 answers
129 views

make master/slave ip in different subnet

For reference, this is a follow-up and variation on group ip address to different subnet with shell We have two strings (named master/slave), the two strings are composed with IPS spread in three ...
peng xiao's user avatar
-3 votes
2 answers
69 views

grep specified variable from a file [closed]

I have a variable like master='172.21.154.37 172.21.250.94 172.21.251.93 172.21.250.94' and I need to check whether the first and the second column in the file both matches the variable. The following ...
peng xiao's user avatar
0 votes
2 answers
47 views

how to extract useragent complete (has spaces) from logfile

logfile line 4/10/2024--06:00pm guest 192.168.1.2 https://nixnut.nz/home/accounts/hosting.cgi?action=getonline Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0 in logview file i ...
nixnut's user avatar
  • 3
0 votes
1 answer
125 views

regex to detect two consecutive lines that have the same words in the same order, but different spaces at leading, trailing and between words

I want to find a regex or perl oneliner to detect two consecutive lines that have the same words in the same order, but the leading spaces, trailing spaces and amount of spaces between the words may ...
Sistemas Libsur's user avatar
0 votes
4 answers
103 views

How to replace pattern in last line

I'm trying to replace "}," by "}" from the last line of a file : My /etc/firefox/policies/policies.json file like this because I added the certificate lines using a for loop : $ ...
SebMa's user avatar
  • 2,341
1 vote
1 answer
188 views

Symbol lookup error for List::Util Perl module after RHEL7 to RHEL8 upgrade

we have recently upgraded our system from RHEL7 to RHEL8 , and when executing below command we are getting error RHEL7.9 = Perl 5.16.3 RHEL8.10 = Perl 5.26.3 Command 1: perl -MList::Util -e 'print &...
Samurai's user avatar
  • 85
1 vote
1 answer
42 views

perl: Use "-" for standard input with 3-arg open

The old 2-arg version of open (i.e., open FILEHANDLE,EXPR) to open a file in perl is deprecated. For security reasons, it should be replaced by the 3-arg version open FILEHANDLE,MODE,EXPR. There is ...
Uwe's user avatar
  • 3,329
1 vote
3 answers
84 views

Why does this Perl Regex one-liner not respect the \U escape sequence?

Why does this Perl Regex one-liner not make the full result upper case using the \U modifier? I expect MY_NICE_WORD. $ perl -pe 's/(?<=[a-z])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][a-z])/\U$1_$2\E/g' <(...
Jonathan Komar's user avatar
-1 votes
3 answers
131 views

Remove duplicate but uncomplete strings of text

I have a hard time figuring out how to remove duplicate but incomplete strings of text. No success using perl, awk or sed. I need to transform: a b a b c a b c d a b c d e a b c d x a b c d z into a ...
Simon Ante's user avatar
7 votes
1 answer
270 views

Where are Perl arrays @0, @9999 documented?

$ perl -wle 'my @388=0..2;' Can't use global @388 in "my" at -e line 1, near "my @388" Execution of -e aborted due to compilation errors. $ perl -wle '@388=0..2;' $ Where can I ...
Dan Jacobson's user avatar
1 vote
0 answers
176 views

Problem enabling perl module stream AlmaLinux 8.10

I have an issue with our AlmaLinux 8.10 systems that they suddenly have issues with perl dependancies. It tuns out that the current active perl stream is 5.26 (dnf module list perl*) but some packages ...
Stefan Lelieveld's user avatar
-1 votes
3 answers
97 views

Delete 2-line paragraphs, keep 3-line paragraphs, maintain newline between all

On a Linux machine with GNU tools I have an ascii file that consists of only 2-line and 3-line paragraphs, each paragraph separated by a newline. All 2-line paragraphs are to be deleted so that all 3-...
stampeder's user avatar
0 votes
1 answer
379 views

version `XCRYPT_2.0' not found after Update Debian 10 to Debian 12

I was instructed to upgrade Debian 10 to Debian 12. After the upgrade, I noticed that the ssh.service was not working. Now I found out that no 'apt' commands work. I can't install anything. Here the ...
Szymon Tesmer's user avatar

15 30 50 per page
1
2 3 4 5
92