Mohd Mohtashim has Published 251 Articles

Database INSERT Operation in Perl

Mohd Mohtashim

Mohd Mohtashim

Updated on 02-Dec-2019 07:48:46

2K+ Views

Perl INSERT operation is required when you want to create some records into a table. Here we are using table TEST_TABLE to create our records. So once our database connection is established, we are ready to create records into TEST_TABLE. Following is the procedure to create single record into TEST_TABLE. ... Read More

How to create Database Connection in Perl?

Mohd Mohtashim

Mohd Mohtashim

Updated on 02-Dec-2019 07:45:13

342 Views

Assuming we are going to work with MySQL database with Perl. Before connecting to a database make sure of the followings. You can take help of our MySQL tutorial in case you are not aware about how to create database and tables in MySQL database.You have created a database with ... Read More

Destructors and Garbage Collection in Perl

Mohd Mohtashim

Mohd Mohtashim

Updated on 02-Dec-2019 07:43:59

286 Views

If you have programmed using object oriented programming before, then you will be aware of the need to create a destructor to free the memory allocated to the object when you have finished using it. Perl does this automatically for you as soon as the object goes out of scope.In ... Read More

Default Autoloading in Perl

Mohd Mohtashim

Mohd Mohtashim

Updated on 02-Dec-2019 07:42:17

116 Views

Perl offers a feature which you would not find in any other programming languages: a default subroutine. Which means, if you define a function called AUTOLOAD(),  then any calls to undefined subroutines will call AUTOLOAD() function automatically. The name of the missing subroutine is accessible within this subroutine as $AUTOLOAD.Default autoloading ... Read More

Method Overriding in Perl

Mohd Mohtashim

Mohd Mohtashim

Updated on 02-Dec-2019 07:37:42

318 Views

You can add your additional functions in child class or you can add or modify the functionality of an existing methods in its parent class. It can be done as follows −#!/usr/bin/perl package Employee; use Person; use strict; our @ISA = qw(Person);    # inherits from Person # Override constructor ... Read More

Understanding Inheritance in Perl

Mohd Mohtashim

Mohd Mohtashim

Updated on 02-Dec-2019 07:35:16

886 Views

Object-oriented programming has very good and useful concept called inheritance. Inheritance simply means that properties and methods of a parent class will be available to the child classes. So you don't have to write the same code again and again, you can just inherit a parent class.For example, we can ... Read More

Defining Class Methods in Perl

Mohd Mohtashim

Mohd Mohtashim

Updated on 02-Dec-2019 07:32:13

334 Views

Other object-oriented languages have the concept of security of data to prevent a programmer from changing an object data directly and they provide accessor methods to modify object data. Perl does not have private variables but we can still use the concept of helper methods to manipulate object data.Lets define ... Read More

Creating and Using Objects using Perl

Mohd Mohtashim

Mohd Mohtashim

Updated on 02-Dec-2019 07:29:20

148 Views

To create an instance of a class (an object) we need an object constructor in Perl. This constructor in Perl is a method defined within the package. Most programmers choose to name this object constructor method new, but in Perl you can use any name.You can use any kind of ... Read More

What are Object and Class in Perl?

Mohd Mohtashim

Mohd Mohtashim

Updated on 29-Nov-2019 12:18:19

115 Views

There are three main terms, explained from the point of view of how Perl handles objects. The terms are object, class, and method.An object within Perl is merely a reference to a data type that knows what class it belongs to. The object is stored as a reference in a scalar ... Read More

Sending an Attachment with email using Perl

Mohd Mohtashim

Mohd Mohtashim

Updated on 29-Nov-2019 12:15:51

2K+ Views

If you want to send an attachment in your email using Perl, then following script serves the purpose −#!/usr/bin/perl use MIME::Lite; $to = 'abcd@gmail.com'; $cc = 'efgh@mail.com'; $from = 'webmaster@yourdomain.com'; $subject = 'Test Email'; $message = 'This is test email sent by Perl Script'; $msg = MIME::Lite-=>new(    From => ... Read More

Advertisements