Skip to main content

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
53 votes
1 answer
1k views

Building Full Perl Support in Ubuntu SDK

I am running Ubuntu v14.04, and after some effort, I have successfully installed the Ubuntu SDK. I need to use Perl + QML/Qt to develop a (potentially large) number of fully-functional apps through ...
Will Braswell's user avatar
29 votes
1 answer
41k views

Using Modifiers of Perl-compatible Regex (PCRE) in grep

According to grep --help and man grep, we can use the -P option in order to interpret the pattern as a Perl regular expression (PCRE, to be precise), instead of the default POSIX basic regular ...
Reflection's user avatar
24 votes
1 answer
47k views

How to set locale?

After a clean Ubuntu Server install, I get the following error when running 'perl'. perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = (unset)...
Olivier Lalonde's user avatar
22 votes
5 answers
228k views

How do I update/install Perl?

The Perl package is in /usr/bin and is an older version (5.12.4). The current stable release appears to be 5.14.2. How do I update this version? Root access is required, and I do not want to compile ...
Robert's user avatar
  • 349
22 votes
5 answers
18k views

How can I merge files on a line by line basis?

cat file1 foo ice two cat file2 bar cream hundred Desired output: foobar icecream twohundred file1 and file2 will always have the same amount of lines in my scenario, in case that makes things ...
TuxForLife's user avatar
  • 1,303
20 votes
3 answers
32k 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.
Curtice Gough's user avatar
15 votes
1 answer
3k 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 ...
dessert's user avatar
  • 40.2k
14 votes
5 answers
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 ...
user avatar
13 votes
3 answers
35k views

How do I replace multiple lines with single word in file(inplace replace)?

Content of my filename file is as following(for example): My block of line starts from here START First line second line third line END and end to here for example. I want to replace block of lines ...
αғsнιη's user avatar
  • 35.9k
12 votes
3 answers
907 views

Is there a Perl or Python script I can write which can minimize the Gnome terminal window?

I'm on Ubuntu 14.04 with the old-style GNOME setting from the GDM. (I don't like the new Unity interface.) Is there a way I can create a command that I can type in my terminal window to minimize it? ...
Volomike's user avatar
  • 2,293
11 votes
4 answers
2k views

CPAN vs. APT: Conflicts in versions?

I can't find the answer to this anywhere: Does a module installed via APT conflict with one installed via CPAN? Along with that question are these: Where do the installed CPAN modules live? Are they ...
Mei's user avatar
  • 1,676
11 votes
2 answers
16k views

Perl 5.20.1 for Ubuntu 14.04

How to update to the latest perl in ubuntu 14.04 x64? Ive tried via apt and and cpan alredy and core wont update.
Medved's user avatar
  • 111
10 votes
1 answer
779 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 ...
american-ninja-warrior's user avatar
10 votes
1 answer
5k views

Rename - what does "s//" vs "y//" mean?

The man page gives two examples: rename 's/\.bak$//' *.bak rename 'y/A-Z/a-z/' * So it's either s or y and then /replaceThis/withThis What does the leading s and y mean? Are there other options?
dan gibson's user avatar
9 votes
3 answers
9k views

How can I use perl 5.12 in 10.10?

How can I use perl 5.12 in Ubuntu? There is no distribution package on Ubuntu. I have to use feature 'unicode_strings'; in my perl code, and this is available from 5.12. I try to install perl on ...
user avatar
9 votes
1 answer
39k views

Trying to install CPAN

I am trying to use CPAN, but I am running into an issue. First I did sudo apt-get install perl. It says it's there. I typed cpan install automatically yes sudo which indicated as done, and I can get ...
user9447's user avatar
  • 1,905
8 votes
3 answers
956 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 ...
Yang's user avatar
  • 95
8 votes
1 answer
34k views

How to create Excel xlsx files from a script?

I'm looking for packages available in Ubuntu main/universe repositories able to create Excel 2007+ xlsx files from a script (python or perl) My requirements: 100% compatible Excel XLSX files. Solid ...
Sylvain Pineau's user avatar
8 votes
2 answers
9k views

How do I undo an accidental installation of all Perl modules?

I was attempting to upgrade my Perl modules through CPAN, but I did not supply a regex/module name to upgrade: perl -MCPAN -e 'upgrade'; I can only assume the worst (which seems to be supported by the ...
paulrehkugler's user avatar
7 votes
1 answer
76k views

How to install Perl Switch.pm module required to build WebKit-GTK?

I noticed that the perl version (5.14) shipped with 12.10 does not include the Switch.pm module needed while building WebKiT-GTK. Looking around on the internet I found few suggestions indicating ...
Sameer Naik's user avatar
7 votes
0 answers
242 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 ...
Momo's user avatar
  • 246
6 votes
3 answers
4k 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=...
J. Doe's user avatar
  • 333
6 votes
8 answers
5k views

How can I delete text that is NOT in quotes or parentheses?

Input: 19. "foo foo" (bar bar) (19) raboof "foo foo" raboof Expected output: "foo foo" (bar bar) (19) "foo foo" As you can see, I would like to keep the double quotes and parentheses. Everything ...
TuxForLife's user avatar
  • 1,303
6 votes
2 answers
43k views

Can't locate LWP

After recent upgrade I can't launch only one of my apps it always gives me this error: Can't locate LWP/UserAgent/Cached.pm in @INC (you may need to install the LWP::UserAgent::Cached module) (@INC ...
JoKeR's user avatar
  • 6,982
6 votes
1 answer
28k views

Ubuntu 15.10 Installing SDL2

I have ubuntu 15.10 running as a virtual machine I would like to install and use SDL2, I followed this process What is the general procedure to install development libraries in Ubuntu? as well as the ...
Ueffes's user avatar
  • 63
6 votes
2 answers
19k views

Vim refuses to start with "error while loading shared libraries: libperl.so.5.14" after upgrade to Ubuntu 14.04

After I upgraded to Ubuntu 14.04 vim refuses to start, showing the following error: vim: error while loading shared libraries: libperl.so.5.14: cannot open shared object file: No such file or ...
orion3's user avatar
  • 405
6 votes
2 answers
5k views

How do I run asciiquarium in out-of-the-box ubuntu?

Asciiquarium is a perl script that requires Term::Animation. What are the appropriate hoops to jump through to get this cpan module into an ubuntu perl install? apt-cache search animation |grep -i ...
John Baber-Lucero's user avatar
5 votes
5 answers
37k views

Accessing MYSQL through terminal

I just installed LAMP in my computer through commandline.Now how can I access MYSQL prompt from commandline?I need to use MYSQL to create tables,views and then access them from my Perl script.
Parvej Islam's user avatar
5 votes
3 answers
3k views

Searching for patterns in csv files

I have file.csv that looks like this 4,6,18,23,26 5,12,19,29,31 2,5,13,16,30 9,10,24,27,32 4,5,10,19,22 4,6,8,10,25 2,3,4,25,11 I want to find some patterns and save them in another log file file....
Lynob's user avatar
  • 6,685
5 votes
2 answers
4k views

Remove all English text and leave Arabic text

This question is a lot like this. I just need a slight modification. I have a csv file that looks like this y(document).ready(function($) { $('#wp_mep_2').mediaelementplayer({ m:1 ...
Lynob's user avatar
  • 6,685
5 votes
2 answers
2k views

How to compare 2 files and extract the particular sequence using ID in first file and print the out put

File 1 (contain only selected IDs): AAX50250 AAX50251 AAX50252 AAX50253 AAX50254 AAX50257 AAX50258 File 2 (Contains sequences with the IDs). This is a FASTA file where lines beginning with as > ...
Nitha's user avatar
  • 51
5 votes
2 answers
11k 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 ...
linuxbasher's user avatar
5 votes
4 answers
9k views

Replace string with multiline file content

I need to replace string SALT in a file with content of another file. Problem is that the input file has multilines. I tried something like this in my bash script: SALT=`cat salt.txt`; sed "s/SALT/$...
Emetrop's user avatar
  • 153
4 votes
3 answers
759 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 |...
Mendel's user avatar
  • 139
4 votes
2 answers
1k 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: ...
Mario Palumbo's user avatar
4 votes
3 answers
2k views

apt-file regex: escaping a dot

I want to find all packages which provide a shared object containing "ssl" in the file name. The apt-file manpage says: --regexp | -x Treat pattern as a (perl) regular expression. ...
langlauf.io's user avatar
4 votes
2 answers
30k views

Installing libwww-perl on Ubuntu 12.04,SE

I have an Ubuntu 12.04 server edition which I ssh into. I am running Perl scripts on this server but it fails when I load 'use LWP::UserAgent;' with error message: Can't locate LWP/UserAgent.pm in @...
john-jones's user avatar
4 votes
2 answers
356 views

adding zero to specific location of file names

I have a directory consists of several files. Files name are as follows; 0102920.05o 0203920.05o 0304920.05o .... I need to add "0" for all files after the first 4 numbers like; 01020920.05o ...
deepblue_86's user avatar
  • 1,194
4 votes
1 answer
421 views

Sequential renaming of files

I found an answer for zero-padding numerical filenames which works fine for renaming filenames as follows : 1.jpg > 00001.jpg 2.jpg > 00002.jpg . . . 9.jpg > 00009.jpg That uses the ...
user avatar
4 votes
2 answers
1k views

Shutter is complaining about that can't locate Carp/Always.pm in @INC

I made a full upgrade from Ubuntu v18 to Ubuntu v20. Shutter was not upgraded - it was removed. I was trying to install from CRAN or from source. Both complain about old Perl libraries. When I am ...
Estatistics's user avatar
4 votes
3 answers
6k views

Ubuntu Upgrade, Perl Version Broke ZImbra

Kind of in a bind here, since I heard about the bash bugs last night I decided on upgrading all off my server, not just the packages but the complete OS, it worked fine on all my servers, except my ...
juhenriquez's user avatar
4 votes
1 answer
2k views

Why doesn't Perl use latest version by default?

When I try to use new perl features (like "say" instead of "print") the code fails until I put in the line "use 5.014;" and then everything runs. My installed version of perl is 5.14.2, and it looks ...
Cait's user avatar
  • 43
4 votes
1 answer
764 views

yum whatprovides 'perl(Foo::Bar)' equivalent with apt or dpkg?

This is certainly related to this question, but I feel it doesn't overlap, so here we go. How can I get the functionality of the following command on Ubuntu (and/or Debian as bonus): yum whatprovides ...
0xC0000022L's user avatar
  • 5,722
4 votes
1 answer
7k 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&...
Barry Kimelman's user avatar
4 votes
1 answer
3k views

Perl doesn't include directory

I have a problem with perl5 with ubuntu. I've got a script, in which I include several directories. When starting the script, the shell returns Can't locate XML/Twig.pm in @INC (@INC contains: /...
Johannes Nielsen's user avatar
4 votes
1 answer
3k views

How to stop cron from sending email when there is nothing in STDOUT or STDERR?

Ubuntu 14.04lts with Perl 5.18.2. This is a special case where Google did not help me. I do not want to turn off email for all cron jobs, I have about 15 jobs in my crontab. I need to see the ...
Bulrush's user avatar
  • 782
4 votes
1 answer
2k views

Perl package not found with apt

When I try to do an upgrade or install something, apt(-get or aptitude) throw an error, saying that perl can't find XML/SAX/Debian.pm while trying to configure libxml-libxml-perl. Here is the full ...
nefas's user avatar
  • 141
3 votes
2 answers
785 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/...
Brian Wiley's user avatar
3 votes
4 answers
777 views

Bash create custom string

how could in bash a pattern like ROW1 n1 n2 n3 n4 up to 300 be done with some command in bash or also just perl...the delimiter would need to be \t as above
user3069326's user avatar
3 votes
5 answers
7k views

How do I setup sendmail, postfix, or dovecot so that perl can send emails?

Direct Question: I want to enable Perl to send emails. What package(s) should I install to setup a simplistic email server: no need for incoming, only outgoing. I can forward through gmail's SMTP if ...
M. Tibbits's user avatar
  • 1,378

1
2 3 4 5
7