How To Install Perl Module On RHEL?

Hello,

I need to install perl-Expect, so, I executed:

Code:
#  yum install -y perl-Expect
Error: Package: perl-Expect-1.21-14.el7.noarch (epel)
           Requires: perl(IO::Pty) >= 1.03
Error: Package: perl-Expect-1.21-14.el7.noarch (epel)
           Requires: perl(IO::Tty)

Okay, I need to install perl(IO::Pty)

I launched
Code:
# yum install -y "perl(IO::Pty)"
No package perl(IO::Pty) available.
Error: Nothing to do

So, how to install all required perl modules to the RHEL?


Similar Content



*** ERROR: PERL Module Apache::DBI Is Not Installed !

Hello,

I am configuring OCS Server using the following two documentations:

http://wiki.centos.org/HowTos/OCSNG
http://www.howtoforge.com/how-to-ins...-on-centos-5.5

Getting below error during installaton:

""Checking for DBI PERL module...
Found that PERL module DBI is available.
Checking for Apache:BI PERL module...
*** ERROR: PERL module Apache:BI is not installed !
Checking for DBD::mysql PERL module...
Found that PERL module DBD::mysql is available.
Checking for Compress::Zlib PERL module...
Found that PERL module Compress::Zlib is available.
Checking for XML::Simple PERL module...
Found that PERL module XML::Simple is available.
Checking for Net::IP PERL module...
Found that PERL module Net::IP is available.
*** ERROR: There is one or more required PERL modules missing on your computer !
Please, install missing PERL modules first.""

i have googled for the solution unsuccessfully.
please help me in installing the missing perl module.

thanks in advance..

--
Anil Anji

Which Perl Module To Include To Use String Length Function?

HI all,
I'm writing a perl script to automate VM UUID transformation into a format used by our ServiceNow CMDB/discovery.

Anyone know which perl module to include to use the string length function?

Alternately, how would I determine which perl modules exist that are available to include, vs. which functions each module contains?

thanks in advance,
Tracy Wiseman, software engineer, Silicon Valley

Perl Script Not Running Via Cron

Hi All,

I have perl script which I am trying to run on 1st Monday via cron job.
So I scheduled it as follows:

0 0 1-7 * * root ["$(date '+%a')" = "Mon"] && /usr/bin/perl script.pl

But then it didn't run so checked cron log and it seemed like its missing the command. so added a \ in front of %a and then it picked up the whole command as per cron log.

But still it didnt ran the script. I then change the script to just && echo "test">/tmp/test

Still nothing. if I run it as /usr/bin/perl script.pl it runs though

Thanks in advance.

Disable Warning Messages In Perl..

Hi All,

I'm not a perl programmer, so please help me to disable warning messages. I tried like commenting 'use strict' and 'use warning' in perl program. But it is not working.

All I want is to disable warning messages.

Please note its not actual ping program, But a perl wrapper for ping to display ping output in color (Cope).

Below is output:

Code:
$ ./ping google.com
given is experimental at /usr/local/share/perl/5.20.2/App/Cope.pm line 255.
when is experimental at /usr/local/share/perl/5.20.2/App/Cope.pm line 256.
when is experimental at /usr/local/share/perl/5.20.2/App/Cope.pm line 259.
when is experimental at /usr/local/share/perl/5.20.2/App/Cope.pm line 262.
given is experimental at /usr/local/share/perl/5.20.2/App/Cope/Extra.pm line 119.
when is experimental at /usr/local/share/perl/5.20.2/App/Cope/Extra.pm line 120.
given is experimental at /usr/local/share/perl/5.20.2/App/Cope/Extra.pm line 159.
when is experimental at /usr/local/share/perl/5.20.2/App/Cope/Extra.pm line 160.
when is experimental at /usr/local/share/perl/5.20.2/App/Cope/Extra.pm line 161.
PING google.com (173.194.36.4) 56(84) bytes of data.
64 bytes from bom04s01-in-f4.1e100.net (173.194.36.4): icmp_seq=1 ttl=57 time=67.8 ms
64 bytes from bom04s01-in-f4.1e100.net (173.194.36.4): icmp_seq=2 ttl=57 time=68.1 ms
64 bytes from bom04s01-in-f4.1e100.net (173.194.36.4): icmp_seq=3 ttl=57 time=66.6 ms
64 bytes from bom04s01-in-f4.1e100.net (173.194.36.4): icmp_seq=4 ttl=57 time=66.6 ms
^C
--- google.com ping statistics ---
4 packets transmitted, 4 received, 0 packet loss, time 3004ms
rtt min/avg/max/mdev = 66.687/67.353/68.155/0.743 ms

Works fine when error redirected to /dev/null
Code:
$ ./ping google.com 2>/dev/null
PING google.com (173.194.36.1) 56(84) bytes of data.
64 bytes from bom04s01-in-f1.1e100.net (173.194.36.1): icmp_seq=1 ttl=57 time=68.4 ms
64 bytes from bom04s01-in-f1.1e100.net (173.194.36.1): icmp_seq=2 ttl=57 time=66.6 ms
64 bytes from bom04s01-in-f1.1e100.net (173.194.36.1): icmp_seq=3 ttl=57 time=66.4 ms
^C
--- google.com ping statistics ---
3 packets transmitted, 3 received, 0 packet loss, time 2003ms
rtt min/avg/max/mdev = 66.419/67.179/68.421/0.885 ms

Unfortunately, I cannot use output error redirection because all the perl programs are in PATH.

Actual ping perl program:
Code:
#!/usr/bin/env perl
use App::Cope;
use App::Cope::Extra qw[ping_time percent_b];
use Regexp::Common qw[net];

sub process {

  # header
  line qr{^PING (\S+)} => 'blue bold underline';

  # ping replies
  line qr{time=([0-9.]+ ms)\b}    => \&ping_time;
  mark qr{\($RE{net}{IPv4}\)}     => 'blue';
  line qr{(?:icmp_seq|ttl)=(\d+)} => 'bold';
  line qr{^(?:\d+ bytes )?[Ff]rom ([^:\s]+)} => 'blue bold';

  # final ping statistics
  line qr{(\d+% packet loss)} => \&{ percent_b 0, 1, 26 };
  line qr{min/avg/(?:max/mdev|ewma/max)\s=\s
	  ([0-9.]+)/    # minimum
	  ([0-9.]+)/    # average
	  ([0-9.]+)/    # maximum or moving average
	  ([0-9.]+\sms) # mean deviation or maximum
       }x => ( \&ping_time ) x 4;

}

run( \&process, real_path, @ARGV );

Code:
$ head -n15 /usr/local/share/perl/5.20.2/App/Cope.pm
#!/usr/bin/env perl
package App::Cope;
#use strict;
#use warnings;
use 5.010_000;
use Carp;

our $VERSION = '0.99';

=head1 NAME

App::Cope - Functions for the B<cope> program

=head1 SYNOPSIS

Code:
$ head -n15 /usr/local/share/perl/5.20.2/App/Cope/Extra.pm
#!/usr/bin/env perl
package App::Cope::Extra;
#use strict;
#use warnings;
use 5.010_000;

=head1 NAME

App::Cope::Extra - Pre-defined highlighting syntax for common patterns

=head2 SYNOPSIS

  use App::Cope::Extra;

  line qr{User: (\S+)} => \&{ user 'yellow' };

Thanks

Perl One Liner To Delete Line In Csv File If One Columns Is Toobig

I have a little bash script that cats out a file and tells me if there is a line
where the 11th column has more than 6 characters in it.
It emails me where there is a bad line in a file - bead meaning that it will break a
donwstream process.

anyhow when i get the email saying that there is a bad file i just log in to the pc via
vpn and the I sed out the lines from the file that I get in the email. The bad lines are
always in danny.csv not danny1.csv
It has been the same lines killing the downstream process for a few weeks, so i put the "sed -i's" into
the script and it does it automagically.

[CODE]
for i in danny.csv danny1.csv
do
cat /come/and/play/with/$i | perl -ne 'print if length((split /,/)[10]) > 6' | mail -s "danny.csv bad line" casper@casperr.com
done

#it would be nice to find a perl change the file in place
sed -i '/D,642,0642,UBF,EVL,,M,,S,S,FOREVER,213,213,/d' /come/and/play/with/us/danny.csv
sed -i '/D,642,0642,UBF,EVL,,M,,S,S,QSP-U=C,4,4,/d' /come/and/play/with/us/danny.csv
[CODE]

However when a new line gets put into this file, I am going to have to log in and take out the line.
SO I have been trying to write a perl one liner that will edit the file in place, like sed, and make a
backup of the file. I just need a perl one liner that will delete any line where the 11th columns has more
than 6 characters in it.
[CODE]
perl -p -i.bak -e 's/\,\w{7}\,//g - which does not work.
[CODE]
I tried something like this:

[CODE]
perl -nle 'print if /\,\w{7}\,/' /come/and/play/with/us/danny.csv
[CODE]
but that does not catch the QSP-U=C and it catches more lines than just the
FOREVER. for a solutinog I need to focus on the the 11th column.

Problem With Epel

Hello

I try to install the epel repository so I can install ejabberd.

I do not have epel, it seems :

Code:
[root@serv src]# ls /etc/yum.repos.d/
CentOS-Base.repo  CentOS-Debuginfo.repo  CentOS-fasttrack.repo  CentOS-Media.repo  CentOS-Vault.repo  n2.repo

So I try to install epel :

Code:
[root@serv src]# rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
Retrieving http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
Preparing...                ########################################### [100]
	package epel-release-6-8.noarch is already installed

But when I try to install ejabberd :

Code:
[root@serv src]# yum install ejabberd
Loaded plugins: downloadonly, fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: ftp.nluug.nl
 * extras: ftp.nluug.nl
 * updates: ftp.nluug.nl
No package ejabberd available.
Error: Nothing to do

Something is wrong with epel.

Unable To Install Php-mcrypt

Hello,

I tried as per http://kb.sp.parallels.com/en/118651

Code:
# rpm -Uvh http://dl.fedoraproject.org/pub/epel...6-8.noarch.rpm
Retrieving http://dl.fedoraproject.org/pub/epel...6-8.noarch.rpm
Preparing...                ########################################### [100%]
        package epel-release-6-8.noarch is already installed



[root@aa ~]# yum install php-mcrypt
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
 * epel: ftp.nluug.nl
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php-mcrypt.x86_64 0:5.3.3-3.el6 will be installed
--> Processing Dependency: php(zend-abi) = 20090626 for package: php-mcrypt-5.3.3-3.el6.x86_64
--> Processing Dependency: php(api) = 20090626 for package: php-mcrypt-5.3.3-3.el6.x86_64
--> Finished Dependency Resolution
Error: Package: php-mcrypt-5.3.3-3.el6.x86_64 (epel)
           Requires: php(api) = 20090626
           Installed: php-common-5.4.26-32.el6.art.x86_64 (@atomic)
               php(api) = 20100412-x86-64
           Available: php-common-5.3.3-38.el6.x86_64 (base)
               php(api) = 20090626
           Available: php-common-5.3.3-40.el6_6.x86_64 (updates)
               php(api) = 20090626
Error: Package: php-mcrypt-5.3.3-3.el6.x86_64 (epel)
           Requires: php(zend-abi) = 20090626
           Installed: php-common-5.4.26-32.el6.art.x86_64 (@atomic)
               php(zend-abi) = 20100525-x86-64
           Available: php-common-5.3.3-38.el6.x86_64 (base)
               php(zend-abi) = 20090626
           Available: php-common-5.3.3-40.el6_6.x86_64 (updates)
               php(zend-abi) = 20090626
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

Please advise

Thanks in anticipation

Need Help Cat Multiple Files To One File

I am currently running a system simulation on multiple files.
I have a computer algorithm written in perl to run "system" simulations for all the files I need

What I am trying to do is put multiple files into one file, only problem is that its not doing exactly what I need it do

Example:

I am "cat txt0.txt txt1.txt txt2.txt txt3.txt > allfiles.txt"

I need it to read as

txt0.txt
txt1.txt
txt2.txt
txt3.txt

Instead its taking all the files and taking the information within each txt file and putting them all together. Info that looks like this


fdfasdfqwdefdfefdkfkkkkkkkkkkkkkkkfsdfasdxfewqfe..........

all clustered together

you get the picture ?

I am really confused how to get this to work, there are over 100 files that need to go into a single file.
That way when I run it through the perl algorithm I created, I can do it in one shot.

Can't Set Repos In RHEL6.0, Unable To Install Packages

Hi all.
RHEL 6.0 in Virtual Box, network is ok, it can resolve all repos (f.e. dl.fedoraproject.org, nginx.org),
but when I'm trying
Code:
# rpm -Uvh http://nginx.org/packages/rhel/6/noarch/RPMS/nginx-release-rhel-6-0.el6.ngx.noarch.rpm

I get:
Code:
curl: (6) Couldn't resolve host

When I'm trying with ip instead name:
Code:
curl: (22) The requested URL returned error: 404

Only rpmforge repo enabled, but it can't find any packets for install/update.

What can I do?
Thanks.

Trouble Installing VMware Tools On Centos 7 Minimum Install

So I'm on the last step of this article to run vmware-install.pl to start installation of my VMware tools and I'm getting this error.

[root@LinuxTest01 vmware-tools-distrib]# ./vmware-install.pl
-bash: ./vmware-install.pl: /usr/bin/perl: bad interpreter: No such file or directory.

I do a ls in the directory and it shows the installer in there.
[root@LinuxTest01 vmware-tools-distrib]# ls
bin doc etc FILES INSTALL installer lib vmware-install.pl


The only step I didnt do in this article is the prereq. first step because Yum is always trying to connect to the internet and my Centos 7 box is on a classified network with no internet access.

http://www.ehowstuff.com/how-to-inst...hel-7centos-7/