Questions tagged [perl]

Perl is a high-level programming language that comes installed by default in Ubuntu. It is well known for it's use for text manipulation, CGI scripts and it's huge community. You can find any modul and many tutorials on http://www.cpan.org/

Filter by
Sorted by
Tagged with
1
vote
2answers
59 views

Problem with Perl installation on Ubuntu 20.04

I am an inexperienced user. I have two different bioinformatics applications using different Perl libraries. I get the following error when trying to execute one of them: /usr/bin/perl: symbol lookup ...
0
votes
1answer
28 views

How to handle format in perl

I want to write the number in two decimal using Perl script. Here is my code. #!/usr/bin/perl -w print "Preparing input files\n"; $incr=0.10; &prepare_input(); exit(0); sub ...
0
votes
1answer
41 views

for loop issues, ls not working right

I have a code that has to be run through Ubuntu. When my code reaches filelist, instead of giving all of the subfolders within the filelist, it gives the same list as from the subjectlist... why is ...
-1
votes
1answer
49 views

nginx hangs if “reload” 2 times

If you execute "service nginx reload" 2 times (this also works with any commands that execute "reload", for example systemctl reload nginx.service) - nginx hangs and stops ...
1
vote
2answers
49 views

Append multiple digits to the end of eatch lines

i need to cat temperature values in /sys/class/hwmon/hwmon[0-9]/temp[0-9]_input and append them to the corresponds names in given file. help !
0
votes
1answer
47 views

WSL Ubuntu why does cpanm install Perl5 modules in the wrong spot?

I have Ubuntu installed under Windows Subsystem for Linux 2 (WSL2). There are Perl5 modules installed under /usr/share/perl/5.30.0 and I can access these with a plain use statement. But when I install ...
0
votes
2answers
69 views

I can launch a Perl script with cron, but can I make it open up a window?

I have an Perl script that runs all night, through a terminal window (Win10 putty.exe) on my Ubuntu server. As with many home networks, I occasionally lose my internet connection, which kills my ...
2
votes
2answers
260 views

replace text with part of text using regex with bash perl

For example I have this output: string1 anynameveryveryverylong string2 string1 othernameveryveryverylong string2 I want truncate the name to the first ten characters: string1 anynamever string2 ...
0
votes
1answer
24 views

Can I stop SSH Terminal window, into Ubuntu command line, from closing on error in Perl script?

My apologies if I am in the wrong Stack section, if I am please just let me know and I will delete this post. I am running Perl scripts on my Ubuntu server, 18.04. I run them from my Mac and PC. One ...
0
votes
0answers
23 views

lwp-rget for 20.04.1

lwp-rget man page excerpt below lwp-rget - Retrieve web documents recursively SYNOPSIS lwp-rget [--verbose] [--auth=USER:PASS] [--depth=N] [--hier] [--iis] [--keepext=mime/type[,mime/type]] [--limit=...
3
votes
3answers
180 views

bash perl \z doesn't work

I have this text file or sdout: text1 text2 text1 text2 text1 text2 I have this code: perl -pe "s/text2\n\z/text3/s" text.txt #Note the modifier "/s" I with \z expect him to ...
-2
votes
2answers
196 views

Replace only last occurrence of a string using perl command

I have a stdout or a file does not matter: mela pera banana caffè mela pera banana caffè mela pera banana caffè I want remove only last occurrence of "mela" using perl: mela pera banana ...
0
votes
1answer
187 views

Install perl 5.10.1 on Ubuntu 18.04

I am trying to install an old version of perl (5.10.1) since it is a dependency for software I want to use (and newer versions do not work). I downloaded the source from https://www.cpan.org/src/...
0
votes
1answer
365 views

Ubuntu 20.04,1 failing to install perl modules

for example File::Slurp Reading '/root/.cpan/Metadata' Database was generated on Sun, 06 Dec 2020 19:29:03 GMT Running install for module 'File::Slurp' Checksum for /root/.cpan/sources/authors/id/C/...
0
votes
0answers
82 views

Make issue in Ubuntu 20.04

I have a "make file" to install some files, which will highlight syntax in gvim. It was downloaded from Github, for reference. When I attempt to install it was showing some error: "let ...
0
votes
3answers
57 views

Re: How can I escape meta-characters when I interpolate a variable in Perl's match operator?

The link How can I escape meta-characters when I interpolate a variable in Perl's match operator? didn't help me. I have tried with Python: import os line='ID_SN=02 MS=DC:A6:32:7E:74:08 S=* ...
0
votes
1answer
46 views

perl command: Append a line of text only at the first occurrence

I have this input file: text1 match text2 match text3 I have the command that inserts a line before the match: perl -lpe 'print "prepend_me" if /^match$/ && ++$i == 1' text.txt And ...
1
vote
2answers
52 views

perl command: Prepend a line of text only at the first occurrence

I have this input file: text1 match text2 match text3 And I have this command: perl -lpe 'print "prepend_me" if /^match$/' text.txt And its output is: text1 prepend_me match text2 ...
0
votes
1answer
136 views

Perl Module Location Issue

I'm on Ubuntu 20.04 LTS. I ran the following commands to try to connect to my PostgreSQL database: sudo -i -u postgres postgres@{username}:~$ psql This raised the following error: Can't locate ...
0
votes
1answer
49 views

bash perl “and” operator

with a output: apple text1 peach text2 banana text3 melon text4 For delete rows that begin with "apple" or "banana" i put: perl -pe 's/^apple.*\n|^banana.*\n//g' And output is ...
2
votes
2answers
290 views

bash --> perl command: print only the replaced text

I have the file "test.txt" that contains: Val1 = '59' Val2 = '76' Val3 = '42' Val4 = '53' I with this command: perl -pe "s/^Val2 = '(.*)'/\1/" test.txt I Want: 76 But I obtain: ...
0
votes
0answers
71 views

Where can I find the system log files on my ubuntu 20.04.01 LTS system

My system is a ubuntu 20.04.1 LTS system I am working with some perl scripts that use Sys::Syslog to write to the system log. My questions are : Where are the log files that contain these written ...
0
votes
1answer
967 views

perl install DBD::mysql failed on ubuntu 20.04

I have installed the latest mysql database on my ubuntu 20.04 laptop. Next I tried to install all the perl modules I need to write Perl scripts to access my mysql database. I started a "sudo -i&...
3
votes
0answers
312 views

How to install slurm-seff in Ubuntu

I am trying to install Slurm-seff Perl package into Ubuntu 19.10. It has .rpm package to install https://pkgs.org/download/slurm-seff ; but I am unable to install alien to install the .rpm package. ...
0
votes
2answers
51 views

What Ubuntu 20.04 package gives the Perl module Locale::Language?

What Ubuntu 20.04 package gives the Perl module Locale::Language? I've looked on https://packages.ubuntu.com/ but I can't find anything. Web search isn't turning up anything. Not sure I'm searching ...
0
votes
0answers
58 views

How to find dependencies of perl CPAN modules

We install cpan modules in ubuntu with cpan -i <MODULE_NAME> command, but since it's not apt, I don't know how to find the dependencies. I read that cpan modules may depend on other cpan modules,...
3
votes
2answers
469 views

Deleted /usr/share/perl/5.26 because I had /usr/share/perl/5.26.1 folder

Being new to perl and its versions, I thought it worked like R but OBVIOUSLY not. I had folder /usr/share/perl/5.26.1 folder and /usr/share/perl/5.26 folder both with same files so I deleted /usr/...
1
vote
1answer
220 views

Rmarkdown can't install Tinytex

I can't see to get this to work. I installed miktex using instructions at https://miktex.org/howto/install-miktex-unx. I installed with install.packages('tinytex') and then when I do tinytex::...
0
votes
0answers
152 views

How to update @INC for perl installation on 18.04?

So I ran into an issue running an LWP script along the lines symbol lookup error: ... undefined symbol: Perl_xs_apiversion_bootcheck and realized I had many duplicate folders with same Modules such as ...
0
votes
1answer
48 views

is there something like brace expansion when using perl rename?

I have 100's of files that I want to remove the beginning numbers from. The files are named similar to below: 048banana.txt 049pear.txt 050watermelon.txt 051tomato.txt 062pepper.txt ...
1
vote
1answer
225 views

Environment Modules can't find installed modules

I'm trying to install and load several Perl modules in Google Colab (a Ubuntu environment). I'm installing them with CPAN, then loading them with Environment Modules. I absolutely need to use ...
0
votes
0answers
343 views

XS.C: loadable library and perl binaries are mismatched

After upgrading from 19.10 to 20.04, launch some otrs 6.0.28 Perl scripts, cause this error: XS.c: loadable library and Perl binaries are mismatched (got handshake key 0xce00080, needed 0xcd00080) On ...
0
votes
0answers
229 views

Perl Libraries configuration, conflicts

I'm having troubles with Perl in my server machine I'm not an admin, but I assume I have created my environment, it was working just fine until I installed Conda. I install Perl using brew so it can ...
2
votes
1answer
326 views

libsnmp-perl 20.04 can not install

I can not install package libsnmp-perl. I hope that the text I pasted is helpful. Distributor ID: Ubuntu Description: Ubuntu 20.04 LTS Release: 20.04 Codename: focal Using sudo apt-...
0
votes
0answers
60 views

Copy column 9 to column to in the same file

I have a gff3 file with 9 columns, I want to copy the 9th column and its content to column 2 of the same file so column 2 and 9 will look identical. Was hoping if there is a way to do that. Appreciate ...
6
votes
0answers
125 views

Nautilus shortcut for “Open in Terminal” and gvfs

I am trying to assign a shortcut to "Open in Terminal" in Nautilus. I have implemented the solution here with nautilus-scripts and the Perl file. While this solution works well for local ...
0
votes
1answer
625 views

Odd number of elements in hash assignment at /usr/share/pkg-config-dpkghook when adding an architecture for cross-compliation?

Someone suggested that I run sudo dpkg --add-architecture armhf to add cross-compilation to my x86_64 box running Ubuntu 18.04 LTS, but it doesn't appear to work: $ sudo dpkg --add-architecture armhf ...
0
votes
1answer
78 views

How to add . in @INC in perl in ubuntu desktop 18.0.4

As the title says i'm looking for a way to do so, i'm using ubuntu/linux for the first time and i had already tried environment variables etc but none of them worked for me. So it would be great if ...
0
votes
0answers
201 views

Software Center got removed by uninstalling Perl

I tried to uninstall Perl from my Ubuntu 18.04.3 LTS by the command- sudo apt-get remove --auto-remove perl Due to this command Software Center app is removed and won't reinstall by install software-...
2
votes
1answer
2k views

loadable library and perl binaries are mismatched

I don't use perl, but I do use Slic3r, which apparently uses perl. I don't know what has done it, but some update somewhere has broken perl and I have no idea how to fix it. I've searched a lot but ...
8
votes
3answers
902 views

How can I change ^L code in many files in Ubuntu?

I have a lot of XML files, over 50000 of them. In some XML files, some files are written like this <filename>abc.JPEG<^Lilename> ^L is just one character, but I can't find what ^L means ...
1
vote
1answer
103 views

How to remove “.” from a filename in Perl?

I do /(\.[^.]+)$/ in Perl to read the extension of a file, for example Text.txt. How can I remove the . so that the output gonna be Texttxt?
2
votes
2answers
4k views

Cannot install Perl Modules on Ubuntu 18.04

I am new to Ubuntu, and for some reason I cannot install any Perl modules. This is my first module install attempt, I believe, fix this and it fixes the rest. hopefully! $ cpanm AnyEvent Can't ...
1
vote
1answer
63 views

How to replace and edit content of file?

I have a file which contains the following content: set0027: set0027_100-250 set0027_1-150 set0027_50-200 set0038: set0038_100-250 set0038_1-150 set0038_50-200 I want to modify it in the following ...
1
vote
1answer
1k views

Install perl to /usr/local/bin

Is it possible to install perl to /usr/local/bin without full sudo permissions namely only sudo apt install ... being allowed. I have a DVD with a software, using /usr/local/bin/perl in shebang, ...
1
vote
1answer
44 views

How to create a directory and store its name in a value?

I want to create a directory and I want to print the directory as a name. My code is as follows: #here $directory = www(subdirectory name) #in @missingfiles I have 1 gif and 1 html file. my @...
2
votes
1answer
166 views

Is there a way to install a2p on Ubuntu?

I need a2p to convert a bunch of awk scripts, but starting with Xenial the perl package does not come with a2p any more. Where can I get a2p from?
0
votes
1answer
989 views

how do i fix this Switch.pm in @INC

I am trying to install NIPE on ubuntu running on my Windows 10 using Windows Subsystems For Linux, I have cloned the file from GitHub and have done some commands which worked, but the command to fully ...
1
vote
2answers
692 views

Unterminated quoted string (Perl)

I am using a new version of perl to run some old script. This is my perl version: This is perl 5, version 26, subversion 1 (v5.26.1) built for x86_64-linux-gnu-thread-multi (with 67 registered ...
-1
votes
5answers
133 views

comparing the content and produce new file

I have two files containing content like the following: File 1 OG5_126568 OG5_126583 OG5_126593 OG5_126596 OG5_126599 OG5_126609 File2 OG5_126568 psychrobacter_aquaticus.txt WP_021813339.1 ...

1
2 3 4 5 6