Author: admin
-
Installation
You can start learning the basics of programming in PHP with the help of any of the online PHP compilers freely available on the Internet. This will help in getting acquainted with the features of PHP without installing it on your computer. Later on, install a full-fledged PHP environment on your local machine. One such…
-
Introduction
PHP started out as a small open source project that evolved as more and more people found out how useful it was. Rasmus Lerdorf released the first version of PHP way back in 1994. Initially, PHP was supposed to be an abbreviation for “Personal Home Page”, but it now stands for the recursive initialism “PHP:…
-
Sending Email
Using sendmail Utility Sending a Plain Message If you are working on Linux/Unix machine then you can simply use sendmail utility inside your Perl program to send email. Here is a sample script that can send an email to a given email ID. Just make sure the given path for sendmail utility is correct. This may be…
-
Regular Expressions
A regular expression is a string of characters that defines the pattern or patterns you are viewing. The syntax of regular expressions in Perl is very similar to what you will find within other regular expression.supporting programs, such as sed, grep, and awk. The basic method for applying a regular expression is to use the pattern binding operators…
-
Coding Standard
Each programmer will, of course, have his or her own preferences in regards to formatting, but there are some general guidelines that will make your programs easier to read, understand, and maintain. The most important thing is to run your programs under the -w flag at all times. You may turn it off explicitly for…
-
Special Variables
There are some variables which have a predefined and special meaning in Perl. They are the variables that use punctuation characters after the usual variable indicator ($, @, or %), such as $_ ( explained below ). Most of the special variables have an english like long name, e.g., Operating System Error variable $! can…
-
Error Handling
The execution and the errors always go together. If you are opening a file which does not exist. then if you did not handle this situation properly then your program is considered to be of bad quality. The program stops if an error occurs. So a proper error handling is used to handle various type…
-
Directories
Following are the standard functions used to play with directories. Display all the Files There are various ways to list down all the files available in a particular directory. First let’s use the simple way to get and list down all the files using the glob operator − Here is another example, which opens a directory and…
-
File I/O
The basics of handling files are simple: you associate a filehandle with an external entity (usually a file) and then use a variety of operators and functions within Perl to read and update the data stored within the data stream associated with the filehandle. A filehandle is a named internal Perl structure that associates a physical file…
-
Formats
Perl uses a writing template called a ‘format’ to output reports. To use the format feature of Perl, you have to define a format first and then you can use that format to write formatted data. Define a Format Following is the syntax to define a Perl format − Here FormatName represents the name of the format.…