≡ Menu

Perl

Q: How do I connect to a MySQL database from a perl program? I like to connect to an existing mysql database and select records from a particular table. Can you explain with a simple working example? A: You should use perl DBI module to connect to a MySQL database as explained below. If you [...]

{ 2 comments }

In our previous test automation article, we learnt about how to write testcases for a simple perl script using Test::Simple and prove command. In this tutorial, we’ll explore advanced perl testing functions that are part of Test::More perl module. For those who are new to perl testing, start with this perl testing introduction article. For [...]

{ 3 comments }

How to Force Install a Perl Module using CPAN

On an ongoing basis, I’ll be answering some of the questions asked by TGS readers. If you have any questions, use the contact form to get in touch with me. The following question is from one of the regular readers of TGS. Question: I’m trying to install a perl module using CPAN, and it displays [...]

{ 3 comments }

Introduction to Perl Testing Using Test::Simple and Prove

Testing is an important part of SDLC activity. By automating the testing process, you can save considerable amount of time spent on testing. There are several modules available in Perl to automate testing process. In this introduction article, let us discuss about how to write basic and simple test cases using Test::Simple module in perl. [...]

{ 3 comments }

SWIG Perl Examples – How to Interface Perl to C Using SWIG

SWIG stands for Simplified Wrapper and Interface Generator. SWIG is used to simplify the task of interfacing different languages to C and C++ programs. For our discussion, in this article we will explain how to use SWIG to interface from Perl to C programs. Some may think, why would one write Perl programs and call [...]

{ 4 comments }

5 Useful Perl 5.10 Features – Say, State, ~~, Defined OR

Even though Perl 5.10 is an old release, there are few things that was introduced in Perl 5.10, which you might find it useful. In the future article of this series, we’ll be covering new features of Perl 5.14 These are the 5 new Perl 5.10 features that you might find helpful. 1. Say it [...]

{ 3 comments }

If you want to manipulate excel files programmatically, you can use Perl Spreadsheet module, which provides an object interface that makes it easier to create and parse Excel files. Install Spreadsheet WriteExcel Module Method 1: Standard install using make Download the zipped tar file of Spreadsheet-ParseExcel and Spreadsheet-WriteExcel from cpan. Untar and unzip the module as follows: [...]

{ 16 comments }

2 Memory Regression Perl Scripts for Linux

During performance testing of your application you might want to perform some sort of memory regression testing. This article contains two memory regression scripts that are written in perl which will occupy a specific amount of memory for a certain amount of time, for your testing. 1. Basic Memory Regression Script To execute this script, [...]

{ 6 comments }