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
0
votes
0answers
46 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
23 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
26 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-...
1
vote
1answer
533 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
888 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
76 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
2k 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
57 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
648 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
43 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
113 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
575 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
381 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
132 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 ...
4
votes
3answers
256 views

How to replace the content to multiple files?

I have multiple files containing content like the following: File 1 NC_12548 og789 |nd784 -2 -54 -6 NC_12548 og789 |nd784 -2 -54 -6 NC_12548 og789 |nd784 -2 -54 -6 File2 NC_54456 og789 |...
0
votes
0answers
72 views

Getting specific 'Out of memory!' message when running Perl script

I have also a problem with an "Out of Memory" by running a simple pearl script. In xubuntu 16.04 it works without errors. With 18.04 it doesn't work any more. I have to send different HL7-messages ...
0
votes
1answer
104 views

How to replace consecutive characters from directory names, recursively

What is the best way to replace all consecutive characters such as _+-."'? from a directory and all sub directory's names using GNU bash, version 4.3, using tools awk, sed, Perl rename or find? AS ...
0
votes
0answers
74 views

Extract specific field in matrix

I am trying to extract some fields from a .txt file to generate another table. It is a matrix (size varies time to time) separated with ; (further by \ in header), each field can have >= 1 numerical ...
0
votes
1answer
64 views

Perl Make GLOB ignore case

How can i make the following line ignore case perl -MFile::Glob=:bsd_glob -lne 'unlink glob' -- /volume1/<file.list I tried experimenting with GLOB_NOCASE but i might be placing it wrong or it ...
1
vote
0answers
129 views

Converting a string of Perl code to BASH code

I have this string of Perl code (which i didn't write) that it would be awesome if is converted to BASH code: perl -pe '$j=0; while ( s{.{$j}\K(\d+):}{/} ) {$j += $1+1}' By using it in terminal: ...
0
votes
0answers
87 views

Trying to create a archive tester for rar and 7z in perl

i'm trying to create a archive tester for a directory for rar and 7z in perl, my 7z can't handle rar and i can't install the rar function for 7z. I borrowed a PERL script and adjusted it for rar ...
2
votes
2answers
234 views

Install fbmenugen: where are the perl-linux-desktopfiles and the perl-file-desktopentry dependencies

I found this nice script for generating the menu on fluxbox: https://github.com/trizen/fbmenugen But for my needs I need to find the libraries perl-linux-desktopfiles and perl-file-desktopentry. Do ...
0
votes
1answer
52 views

Can I give the default user that runs Perl scripts from cgi-bin different permisions?

The default user that Perl scripts run from browsers is www-data. My scripts need permission to read/write/delete files in other directories. All these directories are created within the /home ...
-1
votes
2answers
1k views

Insert a line of text after the line containing the last occurence of a specified word

Basically, I want to insert a line of text after the line containing the last occurence of a specific string, without affecting the rest of the file. I imagine I should proceed like this: delete ...
0
votes
0answers
188 views

Unable to install tightvncserver on Ubuntu 16.04

Hi is there anyone encounter this error before? I have tried many ways removing and reinstall etc, but it still just don't work. Is it because there is another version of PERL exist on the server? ...
6
votes
3answers
2k views

How do I carry my variables from a Bash script into a Perl one?

I have variables in a bash script that I need to be carried over into a perl one. I have the variables $gal and $obsid declared in the bash script, and then I call the new program. gal=UCLA121 obsid=...
2
votes
1answer
381 views

How to make youtube-viewer zip package installable for 18.04

I've recently upgraded to 18.04 and miss youtube-viewer which is not in the repo (yet??). This thread has an answer in which the poster says they got it working by downloading youtube-viewer-master....
2
votes
1answer
120 views

Add minutes to date time column

Thanks to various contributors resolving my previous request. I need to add minutes to the date column to get new datetime stamp value. I have a file : afile.txt 1,2012-02-16,abc,aa,455,340 3,2015-...
3
votes
1answer
3k views

Cannot assign address inside a Docker container

I want to use the rsub package for Sublime Text, in order to edit code inside a Docker container which runs on a remote server. However when I execute rsub my_code.py I get the error: /usr/local/...
1
vote
3answers
206 views

echo first group in perl

Is there a more elegant perl command for this? ps -ejH | grep 'bash' | head -1 | perl -E ' if( <> =~ /(bash)/) {say $1}' I just want to echo the PID which is the first group of chars.
0
votes
1answer
1k views

Ubuntu 16.04, how to downgrade perl 5.22 to version 20 system wide

Perl 5.22 deprecated defined arrays. Got a cgi-bin that's not working as a result. How do I downgrade perl to 5.20 system wide?
1
vote
0answers
1k views

Error Perl after upgrading

After upgrading from 17.04 to 17.10 I tried to use my program as usual which require Perl but I got this error: Encode.c: loadable library and perl binaries are mismatched (got handshake key ...
0
votes
1answer
40 views

Putting a newline whenever it match third space

I have a data that looks like this : 8.620 -9.182 1.758 8.786 -8.249 -0.495 8.614 -9.652 -1.158 9.446 -9.278 0.350 11.450 -7.809 0.887 10.638 -9.000 2.070 11.179 -10.871 -1.200 7.583 -10.330 0....
10
votes
1answer
729 views

Is it possible to implement a “name” booking system using linux file permissions

I have a linux multi user server with 100+ users in /etc/passwd I would like to allow users to "book" / "reserve" a name of their liking (in this case a subdomain, but that details doesn't matter) I ...
3
votes
3answers
125 views

Extract a number which is assigned to a string using a Perl script

I have a file input.txt which has some strings and each string has some values assigned to it. My task is to write a Perl script to extract the number which is assigned to any of the strings. For ...
0
votes
0answers
81 views

Syntax error running shutter and apt. Suspect perl has something to do with it

I am getting a really strange error running apt and some other programs. I think it may have something to do with perl. I discovered the issue trying to run shutter: $ shutter syntax error at /usr/...
2
votes
1answer
708 views

cpan / perl messed up

Lubuntu Xenial. I seem to have messed up my system perl. cpan returns: bash: /usr/local/bin/cpan: no such file or directory (I built a newer perl version from source in that directory, but removed ...
2
votes
1answer
1k views

Perl locale setting warning

What should I do to fix this locale setting warning? I have searched already the web but I am a newbie and I am a bit lost... edwin@ubuntu:~$ perl -e exit perl: warning: Setting locale failed. perl: ...
14
votes
5answers
3k views

Unable to find ack in Ubuntu 17.10 repositories

I am trying to install ack via apt but it seems it's no longer available in the repos. Both: sudo apt install ack sudo apt install ack-grep give the following error: E: Package 'ack-grep' has no ...
0
votes
0answers
759 views

Installing Perl scripts - can't locate WWW/Mechanize.pm [duplicate]

I tried installing Perl scripts and the same procedure worked perfectly with Kali but in Ubuntu MATE it's giving me this error.
1
vote
2answers
3k views

PATH, removing old versions from usr/bin

I'm new to Ubuntu. I inherited a computer from another person. She installed many small programs for bioinformatics in the root folder and /usr/local/bin. I need to be able to remove the old versions ...
0
votes
1answer
81 views

Saving output from external command!

I'm not really how to ask this question the right way without being long winded, but will do my best! I need a script I'm writing to run pidstat -V inside of it and then to capture the output from it ...
-1
votes
1answer
57 views

pidstat and perl!

I hope I phrase this question correctly. I want to write pidstat into a perl script so that when a user runs it he/she is asked for a PID the script then runs pidstat with that specific PID and ...
14
votes
1answer
1k views

What's the difference between the different “rename” commands?

Since Ubuntu 14.04 there are at least three rename commands: rename provided by the util-linux package, see man rename.ul rename provided by the perl package, see man prename rename provided by the ...
2
votes
2answers
6k views

Cannot load cgi-library into perl-cgi-script

I'm trying to run a perlscript as a cgi-Script. However including the cgi-library of perl doesn't work: # perl -e 'use CGI::Carp qw(fatalsToBrowser);' Can't locate CGI/Carp.pm in @INC (you may need ...
1
vote
0answers
129 views

Find what version of specific perl packages available per ubuntu release

I'm in need of knowing what module version a certain perl package (e.g. Net::Cmd) is available in different Ubuntu versions. I'm currently on 16.04 and need a later version of Net::Cmd to resolve (...
0
votes
1answer
123 views

How can I save a log of an Ubuntu server terminal on an external PC using SSH?

I am using a script to automatically log in to a server: #!/usr/bin/perl use Net::SSH::Perl; my $host = "hostname"; my $usr = "my userid"; my $pwd = "my password"; my $ssh = Net::SSH::Perl->new($...
8
votes
2answers
12k views

How do I install asciiquarium?

How do I install and run asciiquarium in Ubuntu? It seems kind of complicated, and I don't know how to compile source code.
1
vote
1answer
202 views

Shell How install local bulk of packages [duplicate]

I have 20 or 30 deb files within a folder in a local directory, lets say /home/Downloads. Given that the amount of files may vary, I need a script(or command or whatever) which installs all these .deb ...
1
vote
1answer
964 views

Getting error “Perl may be unconfigured” when trying to install dependencies

I'm new to ubuntu, currently using ubuntu 17 and trying to run sudo apt --fix-broken install because i have this red error thing showing up close to my network indicator at the top saying "An Error ...

1
2 3 4 5 6