Archive

Archive for the ‘Perl’ Category

CentOS 5 install Perl 5.10+

November 15th, 2010 6 comments

Perl 150x150 CentOS 5 install Perl 5.10+

Q: I tried to run a Perl program but it says that Perl 5.10 is needed. How do I install it on CentOS?

A: CentOS 5.x ships by default with Perl version 5.8.8 as you can confirm running the following command :

perl --version

This is perl, v5.8.8 built for x86_64-linux-thread-multi 

While this is not a big issue and you should normally be fine with this version of Perl some programs could require an higher version of the interpreter. CentOS 6 will ship this version of Perl by default but on CentOS 5.x there is no rpm package to install and you have to compile Perl by hand, let’s see how.

I cannot give you a complete list of needed packages to compile the new Perl version, my system had everything already installed so should be the same for you, but I know for a fact that you will need make and gcc so install them with the following :

 yum install make gcc 

One done this download the Perl source code from here and uncompress the file to a location convenient for you. Once you have the file uncompressed just issue the following command from that directory :

 sh Configure -de -Dusethreads 

The -de switches are used to answer with the default answer to any compilation question and the -Dusethreads is used to compile interpreter to support threads. Once the installation has been correctly configured simply issue the “standard” make commands to have your new Perl installed and configured on your system with the following commands :

 make

make test

make install 

Pay attention when you run make install as the compiler will ask you which path Perl should be installed in in my case (default) this was in /usr/local/bin/perl

Congratulations now you can now enjoy the new version of Perl 5.1x!

I hope you found the article useful, if so please spend some time to retweet the article or to leave a comment.

Cheers Lethe.

VN:F [1.9.20_1166]
Rating: 4.2/5 (6 votes cast)

Incoming search terms:

How to test SMTP Connection

November 10th, 2010 No comments

SMTP 150x150 How to test SMTP Connection

Hello all and happy new year! Even if I should be on holiday I’m working from home, and while I’m waiting for me colleague to call me back from the office I’ve thought to post this sharing something I use often.

In my work I often deal with Mail servers, which were and still are my field of specialization, and one of the most basic tasks I deal with when installing new servers is checking SMTP daemon (or service) is working properly, as you know this is pretty easy to accomplish opening a telnet connection to the server we want to test and writing the verbs needed to the SMTP daemon. This is pretty easy and standard but I’m a lazy person and this morning while testing a new server I’ve written this little and dirty script to do the job for me icon wink How to test SMTP Connection

Here we go :

<pre lang="bash">#!/bin/sh
( echo HELO ccielogs.com
sleep 2
echo MAIL FROM:
sleep 2
echo RCPT TO:
sleep 2
echo DATA
sleep 2
echo Subject:Test-Mail!
sleep 2
echo If you can read this, it Works!!!
sleep 2
echo .
sleep 2
echo QUIT
) | telnet XXX.XXX.XXX.XXX  25

To make this work all you have to do is to modify the Mail From and Rcpt to fields so that valid sender and recipients are listed (this is not strictly necessary but would help being able to read the test mail just to be extra sure), last modification needed is of course the IP address of the server to test.

Once copied all you have to do is to save the file as smtp.sh (or whatever name you like) and make it executable or launch it with sh smtp.sh.

If you you found this useful or informative please a moment to retweet it or leave a comment I would love to hear from you!

Lethe.

VN:F [1.9.20_1166]
Rating: 0.0/5 (0 votes cast)

Incoming search terms:

Categories: Featured, Perl, Scripting