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,392 questions
0 votes
0 answers
12 views
Perl: Why is the position of `[:space:]` within a character class seemingly important? [migrated]
I'd like to use constants to build regular expressions. However, in this case I got an unexpected syntax error: me:~> cat foo.pl #!/usr/bin/perl use strict; use warnings; use constant CR_SAFE =&...
0 votes
3 answers
72 views
Can I use PERL_LWP_SSL_VERIFY_HOSTNAME with HEAD(1)?
Sure, PERL_LWP_SSL_VERIFY_HOSTNAME=0 will probably work if one is willing to write scripts: https://stackoverflow.com/questions/6795030/how-to-ignore-certificate-verify-failed-error-in-perl But I just ...
0 votes
0 answers
72 views
how to convert hex memory dump to Docsis config file?
Hex memory dump is Docsis config file. Is it possible to convert this hex dump info valid Docsis config file? Preferably, using Perl and DOCSIS::ConfigFile module. (or Python scripts, python-docsis). ...
2 votes
1 answer
222 views
Replacing the domain string in the compiled binary file with an IP address
Just in theory: is it possible to replace the domain string in the compiled binary file with an IP address by editing a binary file in place with sed? (IP address belongs to a different domain, but ...
3 votes
2 answers
214 views
Syntax Error on ssed for Regex Subroutine definitions
I'm stuck with this error without clue or reference how to solve it: I have this list on text.txt Angie Apple Angie Banana Angie Tomato Angie Peach Angie Onion I'm running substitution through ssed (...
-1 votes
3 answers
269 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 /"(.*?)"/' ...
3 votes
6 answers
253 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 ...
-4 votes
6 answers
265 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 ...
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 # ...
0 votes
1 answer
262 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: ...
1 vote
1 answer
96 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 ...
6 votes
3 answers
596 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 ...
2 votes
1 answer
595 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 ...
0 votes
1 answer
105 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 ...
1 vote
1 answer
48 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 ...