Questions tagged [perl]
Perl is a powerful, high level programming language. Questions about Perl should be limited to the Perl development environment, running Perl, or using Perl to automate tasks on your computer.
501
questions
194
votes
18
answers
162k
views
Removing ANSI color codes from text stream
Examining the output from
perl -e 'use Term::ANSIColor; print color "white"; print "ABC\n"; print color "reset";'
in a text editor (e.g., vi) shows the following:
^[[37mABC
^[[0m
How would one ...
0
votes
2
answers
6k
views
Can't locate Switch.pm even when installed
A colleage recently tried updating some code via conda and in the process broke our installation of bioperl.
When trying to run one of our normal inhouse scripts I now get the following error:
(...
0
votes
1
answer
220
views
How to get stock quotes in KMyMoney, GNUCash, or other programs using old/broken perl Finance::Quote
TLDR: I am unable to get online stock quotes from within GnuCash and KMyMoney. It seems that something is wrong with the perl Finance::Quote module. What is the easiest way to fix this?
Background
...
13
votes
3
answers
33k
views
Getting the process id for current perl script
How do I get the process id for the perl process that's running the current script? getppid() doesn't return the same pid as ps -ea| grep .
Is there is an easy way or do I just run the ps -ea command ...
4
votes
1
answer
10k
views
Add a new element to existing JSON array
How can I add "arn:aws:iam::xxxxxxx:role/3" line below "arn:aws:iam::xxxxxxx:role/2" adding a comma after "arn:aws:iam::xxxxxxx:role/2",.
Before:
{
"Version": "2012-10-17",
"Statement": [
{
...
3
votes
1
answer
9k
views
What does --allowerasing option in dnf command do?
I am reading a book which instructs me to install 5.24stream and minimal profile of Perl module by running...
dnf module install perl:5.24/minimal --allowerasing
Everything was explained in it except ...
3
votes
3
answers
663
views
Bash [[ test =~ regex ]] vs perl command result
Is the bash operator =~ equivalent to a perl invocation?
filename="test-33.csv"
regex="([^.]+)(-\d{1,5})(\.csv)"
With bash test:
if [[ "$filename" =~ $regex ]]; then ...
2
votes
1
answer
340
views
Install Perl on Windows for LaTeX Packages Without Dependency Issues
I'm currently facing challenges with installing Perl on my Windows system, which I need for handling specific LaTeX related packages. My journey so far has led me through a series of issues, and I'm ...
2
votes
4
answers
342
views
REGEX Find the string between 2 strings
In the example below, I want to use regex as to find the html tag <sony> between other 2 lines.
<table width="697" border="0">
<tr>
<td&...
2
votes
3
answers
4k
views
How to extract characters between first and second underscores of filenames and count such files in Linux folder?
I would like to extract characters between first and second underscores of filenames in a folder and count such type of files present in it.
The folder contains files in a particular format such as:
...
0
votes
1
answer
62
views
database connection error with perl app (rt 5 - request tracker) connecting to Postgres database
On a CentOS 9 system I installed postgres via dnf
# dnf info postgresql
Last metadata expiration check: 3:26:33 ago on Tue 21 Nov 2023 12:13:48 PM PST.
Installed Packages
Name : postgresql
...
0
votes
1
answer
68
views
AWK replace some special new line to one line
i have some log like this:
2023-11-15T08:59:28.000000+00:00 database-1 # Time: 231115 8:59:28
# User@Host: rdsadmin[rdsadmin] @ localhost []
# Thread_id: 3 Schema: QC_hit: No
# Query_time: 0....
10
votes
7
answers
43k
views
How to convert .xlsx to .txt?
I want to know if there is a Linux tool or a script available to convert .xlsx file to .txt.
0
votes
0
answers
115
views
Perform lookup on two files
I have a csv file that get's SFTP'd to a RHEL box I have setup. It then gets transformed a little before another process SFTP's in and grabs it sending it off to be imported to a DB of a 3rd party.
I ...
1
vote
1
answer
454
views
Combine two regex formulas into one (using notepad++)
Si cum îi semănau ! Fraţi buni, puindu-si, ca si el, tot sufletul
în ceea ce făceau, muncind din greu, luptind din greu, jert-
findu-se, fără nici un gînd de răsplată.
Simțind în tot ceasul,
...