Mohd Mohtashim has Published 238 Articles

Escaping Characters in Perl

Mohd Mohtashim

Mohd Mohtashim

Updated on 28-Nov-2019 07:47:17

604 Views

Perl uses the backslash (\) character to escape any type of character that might interfere with our code. Let's take one example where we want to print double quote and $ sign −Example Live Demo#!/usr/bin/perl $result = "This is \"number\""; print "$result"; print "\$result";OutputThis will produce the following result −This is ... Read More

"Here" Documents in Perl

Mohd Mohtashim

Mohd Mohtashim

Updated on 28-Nov-2019 07:44:52

1K+ Views

You can store or print multiline text with great comfort. Even you can make use of variables inside the "here" document. Below is a simple syntax, check carefully there must be no space between the

Single and Double Quotes in Perl

Mohd Mohtashim

Mohd Mohtashim

Updated on 28-Nov-2019 07:42:27

728 Views

You can use double quotes or single quotes around literal strings as follows −Example Live Demo#!/usr/bin/perl print "Hello, world"; print 'Hello, world';OutputThis will produce the following result −Hello, world Hello, world$There is an important difference between single and double-quotes. Only double quotes interpolate variables and special characters such as newlines , ... Read More

Whitespaces in Perl

Mohd Mohtashim

Mohd Mohtashim

Updated on 28-Nov-2019 07:38:48

897 Views

A Perl program does not care about whitespaces. Following program works perfectly fine −#!/usr/bin/perl print    "Hello, world";But if spaces are inside the quoted strings, then they would be printed as is. For example −Example Live Demo#!/usr/bin/perl # This would print with a line break in the middle print "Hello   ... Read More

Comments in Perl

Mohd Mohtashim

Mohd Mohtashim

Updated on 28-Nov-2019 07:34:26

4K+ Views

Comments in any programming language are friends of developers. Comments can be used to make program user-friendly and they are simply skipped by the interpreter without impacting the core functionality. For example, in the above program, a line starting with hash # is a comment.Simply saying comments in Perl start ... Read More

Perl File Extension

Mohd Mohtashim

Mohd Mohtashim

Updated on 28-Nov-2019 07:30:36

3K+ Views

Perl is a general-purpose programming language originally developed for text manipulation and now used for a wide range of tasks including system administration, web development, network programming, GUI development, and more.A Perl script can be created inside of any normal simple-text editor program. There are several programs available for every ... Read More

Perl First Program

Mohd Mohtashim

Mohd Mohtashim

Updated on 28-Nov-2019 07:28:21

386 Views

Interactive Mode ProgrammingYou can use Perl interpreter with -e option at the command line, which lets you execute Perl statements from the command line. Let's try something at $ prompt as follows −$perl -e 'print "Hello World"'This execution will produce the following result −Hello, worldScript Mode ProgrammingAssuming you are already ... Read More

How to run Perl Program?

Mohd Mohtashim

Mohd Mohtashim

Updated on 28-Nov-2019 07:24:02

10K+ Views

The following are the different ways to start Perl.Interactive InterpreterYou can enter Perl and start coding right away in the interactive interpreter by starting it from the command line. You can do this from Unix, DOS, or any other system, which provides you a command-line interpreter or shell window.$perl -e ... Read More

Perl Installation on Macintosh Platform

Mohd Mohtashim

Mohd Mohtashim

Updated on 28-Nov-2019 07:16:16

380 Views

In order to build your own version of Perl, you will need 'make', which is part of the Apple developer tools usually supplied with Mac OS install DVDs. You do not need the latest version of Xcode (which is now charged for) in order to install make.Here are the simple ... Read More

Perl Installation on Windows Platform

Mohd Mohtashim

Mohd Mohtashim

Updated on 28-Nov-2019 07:12:28

270 Views

Perl distribution is available for a wide variety of platforms. You need to download only the binary code applicable for your platform and install Perl.If the binary code for your platform is not available, you need a C compiler to compile the source code manually. Compiling the source code offers ... Read More

Advertisements