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/
321
questions
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 ...
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 ...
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)...
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 ...
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 ...
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.
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 ...
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 ...
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 ...
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? ...
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 ...
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.
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 ...
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?
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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=...
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 ...
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 ...
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 ...
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 ...
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 ...
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.
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....
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 ...
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 > ...
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 ...
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/$...
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 |...
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:
...
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. ...
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 @...
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
...
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 ...
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 ...
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 ...
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 ...
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 ...
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&...
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:
/...
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 ...
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 ...
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/...
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
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 ...