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.

-2 votes
2 answers
92 views

Perl RegEx one-liner that outputs all matches from one line of STDIN

Here is a silly example that effectively illustrates what I need: echo '"this text", " ", "is in speech marks"' | perl -lne 'print "$1" if /"(.*?)"/' ...
Signor Pizza's user avatar
3 votes
6 answers
221 views

regex to find text plus trailing 10+ spaces; sum of two matches' lengths is part of matching condition

I'm trying to clean files that are copy/pasted versions of my Cygwin (mintty) terminal running bash1. Usually, the input and output are separated by a linefeed ('\n'), as expected. However, when I ...
bballdave025's user avatar
-4 votes
5 answers
226 views

Perl or sed script to remove a specific content of a file from another bigger file

I have a file (FILE1) with some repeated sections as below (example): LINE 1 ABCD LINE 2 EFGA LINE 3 HCJK REMOVE LINE11 REMOVE LINE12 REMOVE LINE13 LINE 4 ABCDH LINE 5 EFGAG LINE 6 HCJKD REMOVE ...
Pratap's user avatar
  • 45
8 votes
4 answers
2k views

Why do my UTF-8 filenames always match against a regex bracket expression in Perl?

Here is a script to fix broken Cyrillic filenames if the files were moved to Mac from Windows (based on an answer to Revert filenames after they were garbled by using different encoding) #!/bin/zsh # ...
jsx97's user avatar
  • 1,357
0 votes
1 answer
207 views

Perl: The module is installed but doesn't work

I remember I have installed Perl::Rename, by using cpan -i File::Rename, and indeed I have $HOME/perl5/bin with rename and unsafe-rename executables there. But when I try to use rename, # Expected: ...
jsx97's user avatar
  • 1,357
1 vote
1 answer
76 views

Git hook on SSH remote fails due to not reading shell configuration

I'm using a git post-receive hook to perform some actions after a git push to a remote server. This remote operates over SSH: $ git remote -v server user@server:repo.git The problem is that ...
sidyll's user avatar
  • 207
6 votes
3 answers
560 views

How to make Perl half/full width-insensitive regular expressions?

In Perl, /a/i matches both A and a, so I don't have to write /A|a/. What is the easy way to write /4|4/ ? Yes, I'm talking about $ unicode 4 4|grep U+ U+FF14 FULLWIDTH DIGIT FOUR U+0034 DIGIT FOUR ...
Dan Jacobson's user avatar
2 votes
1 answer
507 views

Attempt to call undefined import method with arguments ("abs2rel") via package "File::Spec"

I have Debian GNU/Linux trixie/sid and I installed publican from repo of debian. (publican is doing write and publish for DocBook) When I run publican , It get the following messages: Attempt to call ...
PersianGulf's user avatar
  • 11.3k
0 votes
1 answer
91 views

Error when installing ImageMagick with perlbrew

I am trying to install ImageMagick for perlbrew as an application needed a higher version of Perl than the one that came with my Ubuntu, and this application also needs to use ImageMagick. I am on ...
stacking and exchanging woohoo's user avatar
1 vote
1 answer
37 views

What is the "reports" command in install errors

While trying to install the Chart::Clicker perl module, I get a lot of dependency errors. When trying to resolve them, I get similar output for each module from the first to the last module listed in ...
Gene's user avatar
  • 11
3 votes
1 answer
262 views

Replace accented characters with perl-rename

I'm standardizing the name of several files at once, so I wrote a regex for perl-rename: perl-rename 'y/A-Z/a-z/; s/ã|á|â/a/g; s/é|ê/e/g; s/í/i/g; s/õ|ó/o/g; s/ú/u/g; s/ç/c/g; s/(?<=\d-)*\s/_/g; s/...
Alex Braga's user avatar
1 vote
1 answer
56 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
84 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
175 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
86 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

15 30 50 per page
1
2 3 4 5
93