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.

4 votes
3 answers
1k views

Renaming files in Linux using perl scripting

I have a set of files with prefix, say "pre_", on a Linux machine and I just want to rename all of these files by removing that. Here is the perl code I wrote it doesn't throw any errors, ...
Sasi Pavan's user avatar
0 votes
1 answer
65 views

View perl module install error AFTER installed

When installing Perl modules (prerequisites for another program), some module showed me an incompatibility warning and said something about needing to downgrade a package. I thought I would get back ...
TSG's user avatar
  • 1,768
1 vote
1 answer
238 views

Error installing perl BerkeleyDB module

I'm trying to install a program which has various perl dependencies. One of the perl dependencies (BerkeleyDB) fails during install. I know very little about perl. Is there a way for me (as a user) ...
TSG's user avatar
  • 1,768
0 votes
1 answer
553 views

Is PERL5LIB setting needed?

I am copying the following systemd service file from an old server to a new one. I'm new to perl, and trying to understand what else needs to move with the service file (aside from the /usr/local/...
TSG's user avatar
  • 1,768
0 votes
1 answer
31 views

Pipe null terminated file paths twice to same output, but second time sorted by basename

So, let's say I have a script that uses find to print paths with null-terminated filenames. I also want to print another version of the output where each path is sorted by its basename. I want to ...
Eduardo Perez's user avatar
0 votes
4 answers
658 views

Remove hostnames from URL with sed/awk

I got lists of urls with different domains and I want the hostname removed with sed, awk or something similar and only keep the path. There are no urls with port or username@password in it. input: ...
pwrsheller's user avatar
-1 votes
3 answers
132 views

How to replace the contents of out.txt with in.txt in a third file?

I have three files, main.txt, out.txt and in.txt. I want to replace every occurrence of the contents of out.txt in main.txt with the contents of in.txt. Both out.txt and in.txt may contain multiple ...
Roger Bosman's user avatar
2 votes
3 answers
4k views

How to deal with CRLF, CR line endings

I have a Perl script that parses data sent to me from a bunch of school districts. I'm adding a new school and have run into a problem I've never faced before. When I do $line = <INPUT>, it ...
Chanel's user avatar
  • 99
2 votes
0 answers
100 views

Processing large blocklists with GNU Parallel

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 lists.json by transforming the list ...
T145's user avatar
  • 213
0 votes
1 answer
77 views

How to find the text between the nth occurence of a character and occurence n+1 with perl-rename?

perl-rename 1.14-1 Arch Linux: linux 6.2.12.arch1-1 I have a directory/folder with several subdirectories, all are named by one of the following patterns Status quo of existing patterns something-...
henry's user avatar
  • 914
2 votes
1 answer
396 views

How can I pass variables from a Perl script to a Bash script?

I got the duty to make a fix to an ancient Perl script our company uses, I haven't even looked at Perl in about 20 years. So I want to pick up a couple of the variables, and dump them to the ...
BigHoss's user avatar
  • 21
0 votes
0 answers
429 views

Update package perl-*

I have a linux machine Oracle Linux Server 8.7 with kernel 5.4.17-2136.317.5.3.el8uek.x86_64. Using the yum check-update command, I noticed that there are a number of perl-packages that I can't update....
Kanuc's user avatar
  • 41
0 votes
1 answer
201 views

Change file name based on contents

I'm trying to rename a set of files based on what is in the file itself. I have likely more than a thousand files to rename by the time I'm done. I have code that will get me the first part of the ...
JoJA's user avatar
  • 1
0 votes
0 answers
41 views

ubuntu server 22.04.2 LTS not writing to perl based txt files?

I just installed Ubuntu server to create a home webserver for personal use. I added Virtualmin and my pages and cgi all come up as expected. The problem I noticed is when I attempt to open, write to ...
Tf198's user avatar
  • 1
0 votes
2 answers
131 views

what does syntax .= means in perl

I came across a Perl script which uses following .= syntax $key .= $descriptions[$i]; what does .= means here
Worker's user avatar
  • 37

15 30 50 per page
1 2
3
4 5
91