Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [perl]

Perl is a powerful, high level programming language. Questions about Perl should be limited to the Perl development environment, running Perl, or using Perl to automate tasks on your computer.

0
votes
0answers
51 views

get sub info from cli mediainfo

I am writing a Perl script with a call to mediainfo cli version to print info only about subtitles with: 'system("MediaInfo \"--Output=Text\;%ID%: %Format%\$if(%Language/String%, SUBTiTLE: ..............
0
votes
1answer
38 views

how to align lines to the left side with sed or perl one line liner

we have the following file how alignment lines to the left side with sed or perl one line liner more conf.env # Extra ssh options. Empty by default. export HADOOP_SSH_OPTS="-o ConnectTimeout=5 ...
1
vote
1answer
229 views

Problems executing perl on git for windows bash

The issue is that perl is installed in my system and bash can see it, however when I try to execute a perl script that includes a module, there's an error. Can't locate Text/CSV.pm in @INC (you ...
0
votes
0answers
41 views

Gennerate HTML with CGI.pm modul

I've set up apache2 on fedora server and I want to generate HTML with perl script. This is my test script which I made with help from perldoc : #!/usr/bin/perl use strict; use warnings; use CGI; ...
0
votes
0answers
95 views

Installing Net::LDAP on Strawberry Perl running on Windows 7

I am attempting to install Net::LDAP on Strawberry Perl 64-bit (v5.26.2) without success. The command line 'cpanm' fails and points to a build.log. It appears that files are not located where they ...
0
votes
1answer
25 views

Print out data was not similar with input and would like to remove some of the data in the content

I want to try print all the content in .txt input file to process some data but i was facing some problem as the content print out was not tally. May i know why it was like that? Thanks everyone. I ...
0
votes
0answers
59 views

How to protect webmin via .htpasswd?

Originally asked this here but I think it was the wrong site. I have got webmin installed on my Ubuntu. What would be the best way of adding an additional password layer like via .htpasswd file? So ...
1
vote
2answers
348 views

Extract portion of text file from first occurrence of one string to first occurrence of another

How can I extract a portion of a large text file, starting at the first occurrence of FOO and ending at the first occurrence of BAR? In my case, I'm trying to extract a portion of a sql file created ...
1
vote
0answers
36 views

apt is broken relying on broken perl version

while trying to upgrade packages on pibian I am running into the following issues, all issues to resolve it seem to involve upgrading perl which is not possible with apt relying on broken perl At ...
0
votes
1answer
168 views

Trouble doing backup with tar using the results of find command

So I'm doing this perl script to backup my music. It will search for new music added to my disk since the last backup. When this command runs: find ~/Music -type f -mtime -145 | xargs tar -cvf ...
1
vote
0answers
36 views

Script does not run in Browser but it works in command prompt [closed]

I am using an Windows 10 and Apache24 with php72. I am trying to run a perl script that is using Win32::OLE to open an Word document and put some content inside a document. Perl script runs fine from ...
2
votes
1answer
63 views

Why does my Perl regex not work to remove certain strings following newlines?

I have text that looks like this text \centering more text I want to convert it to: text more text Using Perl My code is: perl -00 -pe 's/\R+\\centering\R+/\n/g' example.md It doesn't work at ...
0
votes
2answers
92 views

linux: how to capture the number/s from string

I use the following syntax in order to capture only the number from machine hostname echo machineLinux05 | sed s'/\./ /g' | awk '{print $1}' | sed 's/[^0-9]//g' 05 But this way is not so elegant. ...
2
votes
1answer
118 views

Open batch file and execute commands from there

My intention is to run a perl script latexdiff.pl from a portable version of perl. There is a batch file portableshell.bat which sets up the environment for perl. If I open it and type perl latexdiff....
1
vote
1answer
349 views

grep regex to include the log timestamp

I'm grepping lots of log files for certain Oracle related errors with ORA-xxxxx error codes. All the log entries start with a Timestamp(eg : 2017-11-29 23:51:46,372). Some of the log entries are multi-...
0
votes
1answer
371 views

Can cron “cache” scripts it runs?

Caveats up front: 1. My *nix knowledge is very limited but growing. 2. This particular issue applies to SunOS 5.10 (I know) but I'd be interested in general answers. If a cron entry runs script ...
0
votes
0answers
43 views

In Pidgin, perl.dll is not loadable error

I can find this error in Pidgin's (version Pidgin 2.12.0, libpurple 2.12.0) debug window: (17:57:27) plugins: C:\Program Files (x86)\Pidgin\plugins\perl.dll is not loadable: `C:\Program Files (x86)\...
1
vote
0answers
545 views

Settings LOCALE on Raspberry Pi3

I'm using raspberry for years and Linux for many more... Trying to installing Docker in my rpi I get an error, it is probably related to the LOCALE installation. The problem is this: apt-listchanges: ...
0
votes
1answer
153 views

Script to Reboot Virgin SuperHub

I'm currently trying to write a script that will reboot my Virgin SuperHub when set up as a cron job. However, it keeps failing with the following error: "There is no form with ID "...
0
votes
0answers
27 views

How can I convert SAS data files into something simple like Excel data using Perl?

I am new to Perl.I know how to do the same thing using R and Python but I am unable to do so in Perl. My requirement says it has to be specifically in Perl.
0
votes
1answer
161 views

How to install Qt module on perl?

i want to install perlqt to create a GUI. i see the INSTALL file and it said that a need to install KDE. is really necessary this installation? or just some files. thanks for you reading.
1
vote
1answer
235 views

Net::OpenSSH error module

I am new to CGI scripting I am trying to connect to another server using Net::OpenSSH but giving the following error #!/tools/openbin/perl/5.16.3/sparc-sun-solaris8/bin/perl use strict; use ...
0
votes
2answers
389 views

Replace Single Line with Multline content within the file nginx.conf

I want to make a backup of the file "/etc/nginx/nginx.conf" And then edit it so the following line in the file: include /etc/nginx/sites-enabled/*; Will instead appear as... include /etc/nginx/...
0
votes
1answer
130 views

run piconv within perl script for batch conversion

I am trying to convert a set of Windows 10 files in a directory from ANSI to UTF-8. I have found the following command that works in a command prompt for a single file if the command is run from the ...
0
votes
1answer
40 views

How about make a home made VPN. Am short of money to renew my VPN

Is it possible? For instance I create process that listen 80 and 443 port, collect data, crypt it with special key inside. Then send it to server. Server decrypt data and check key, if key okay, it ...
0
votes
1answer
269 views

split multiple delimiters using perl

I am trying to extract only the FREE HEAP count value which is 1400 from the below line. Here i'm using split function twice to get the value. Can somone help me to get a single regex that would ...
0
votes
0answers
326 views

How to use PowerShell Set-Content?

I have a perl script that produces utf8 output. I tried using Set-Content to write a utf8 file as suggested by Powershell overruling Perl binmode?. perl -S testbinmode.pl | Set-Content "binmode.txt" -...
0
votes
2answers
184 views

Bash script to crosscheck list of names with a firewall config file

I am looking to automate something with a script in bash or python. Let's say I have a config file from a device. A simple config.txt file. Content could be like this (actual file is much longer and ...
0
votes
3answers
557 views

Regex from substring to first occurrence of another substring

I need to eliminate the textClipping files from a list. Unfortuately some files have been terribly named and contain a carriage return. I need the perl regex for that would match each path from /...
0
votes
2answers
175 views

write a command output to a file and match a string

I am new to perl. I'm writing below script to print the system boot time information from the windows command systeminfo. There look some problem here. I'm getting the output like this. Could someone ...
0
votes
1answer
188 views

Cannot access Linux Oracle Databse with Perl Script after connecting with PuTTY

I have the following problem: I currently connect to one of our Linux servers using PuTTY on my Windows 10 machine. If I use a ‘standard’ PuTTY connection I have no problem: I can log in and run my ...
1
vote
0answers
51 views

how to parse a xml which might have zero to N number of nodes using perl

How to handle a xml which might have one or more occurance of node in the file in perl. In the current solution provided below, foreach $FileContainerRec (@{$XmlFile->{FileContainer}}) { $...
2
votes
0answers
116 views

How to debug mod_perl compilation errors during start and reload of Apache httpd 2.4?

I'm running Ubuntu 16.04 LTS with httpd 2.4 and mod_perl2 to host a PerlAuthenHandler for some web app. It has been 14.04 LTS before and was upgraded some weeks ago. This works in general but ...
1
vote
2answers
142 views

bash + PERL hybrid script

I am new to this community, I tried to find relevant answers but could not find any. My question is, I want to use perl script in a directory of files ending with .fasta, if I do in bash as for i in ...
2
votes
1answer
87 views

Run Perl script from CD?

I've created a Perl script and burned it to a CD-ROM disc. I would like to be able to run the script from the CD without having to copy it to some directory on the hard drive. For some reason when ...
1
vote
1answer
96 views

CGIProxy running on macOS fails to connect to sites using SSL

I'm trying to run a web proxy CGIProxy on one of my home servers that's running macOS 10.11.6. I've set up the web server using Apple's Server utility. By and large it works, but there's a few ...
1
vote
0answers
32 views

Why autocompletion did not work?

When I try to autocomplete file name as next: perl t/fiTAB+TAB It work fine. But when I use -d option on command line. It does not: perl -d t/fiTAB+TAB What should I do to make it works?
0
votes
1answer
129 views

I am not receiving the email when I try to send using Perl (MIME::Lite)

#!/usr/bin/perl use MIME::Lite; my $to = 'mkumar@birdserver.com'; my $from = 'pkumar@birdserver.com'; my $subject = "Eventful"; my $message = " Hi - Test email"; $msg = MIME::Lite->new( ...
0
votes
1answer
20 views

mod_perl scripts stop seeing the filesystem after some time

I use mod_perl scripts under Apache 2.4.18 on a VPS under Ubuntu 16.04. The scripts open files from the disk (web page templates). From time to time, they stop seeing these files, the server error log ...
0
votes
1answer
240 views

Count number of separators in CSV lines and print line number

We have a CSV file with more than 50000 lines. This is only an example of the content: Dcccrev,wefrwvfr,rfregt,wr4f,rfvrv,ecxwec,ecfrv,rfrf Grge,gtgr,frfrv,gthtgv,gerg5tgvrt,rvrfvtg,tgt,frfrf,rfrf ...
0
votes
2answers
9k views

Perl script can't locate Env.pm in @INC

I am trying to run a Perl script that, near the beginning, has use Env '$Foo1', '$Foo2'; I am getting the following message: Can't locate Env.pm in @INC (@INC contains: /usr/local/lib64/perl5 /...
1
vote
1answer
111 views

Run application from html button using php/perl

I was wondering if there is any way to open an application or file browser such as nautilus from a local html button using php or perl. The webpage is local and I have php and perl installed. I can ...
2
votes
1answer
389 views

Sed/awk/perl match all prefixes of a given string

I'd like to match all lines in a file that either my word is a prefix of, or the line is a prefix of my word. For example searching for "abc" should match: a ab abc abcd abcxyz but not: ...
0
votes
1answer
37 views

How to add to %ENV more variables for one parrticular perl script

I want to add more variables to %ENV visible only for one script Is it correct or we have some other ways? $ENV{IM_ROOT} = $TC_ROOT; $ENV{IM_DATA} |= $TC_DATA;
0
votes
1answer
52 views

how to read internal environment file in perl?

I convert UNIX script to Perl. In unix we have . ${DTE_WORKING_DIR}/sh/dte.env . ${DTE_WORKING_DIR}/sh/xfer.env . ${DTE_WORKING_DIR}/sh/dte_reports.env . ${DTE_WORKING_DIR}/sh/java.env ...
0
votes
2answers
91 views

Sorting/counting a tab delimitated file

I have a tab delimitated file with multiple columns. I'd like to extra the number of times I see something in column A and print the data associated with the value in column A in a new column B. Ex: ...
1
vote
0answers
272 views

Cannot install Perl module in Ubuntu subsystem on Windows 10 pro

Not sure if I have run into a limitation of the Windows Ubuntu subsystem or something else, I've tried to install sudo cpan install HTTP::Server::Simple::CGI and it's throwing an error. Running the ...
0
votes
0answers
286 views

Replace a line in a text file using sed but keeping \ as part of the replacement line from perl script

What I need done is to replace a line in a file from perl using a sed command. The issue is the line I need to put into the file has \ in several places and I have not figured out how to kepp the \ ...
0
votes
1answer
502 views

Find/replace on specific column in large file with multiple patterns

I have a 100GB CSV file. Looks something like this: 11,aa,gg,tt ew,11,rggr,tr And a second one which specifies substitutions (20,000 lines in this file): gg,q aaa,b What I want to do is to go over ...
0
votes
3answers
88 views

keep the first line that matches a string search and remove all following lines that have the same string matched

I am trying to keep the first line that matches a string search and remove all following lines that have the same string matched. Any ideas? $ cat example-input.txt Question one|some other text ...