July 6, 2022

Running PERL

before you may need to read about practitioner programming perl, ok next,.
The easiest ways to run the program is to call the perl interpreter and perl program name as argument
perl example.pl
Name of program or file is example.pl perl and perl is the name of the perl interpreter. Of course the above perl program assumes that the perl path is known, if not then we need to call the full path as follows:
/ usr / local / bin / per example.pl
Well if you are using Windows 98 or Windows NT, you can call in a way that is almost the same, namely:
C: \ Ntperl \ perl example.pl
Of course the way in making up a bit. For that we can simplify the called without including the name of the perl interpreter, so just the name of the file perl-its only

example.pl

There are several things that must be done on a Unix system, namely:

  1. Adding the full path location of the perl interpreter on file dibaris first perl program as follows:#! / usr / local / bin / perl
    # Name of Program: hello.pl
    print “Hello World \ n”;
  2. So that the perl program file can be executed directly, it is necessary to change the file mode as the mode of execution of the file system UNIX, that is

Chmod + x example.pl

On Windows systems, to make a perl program can be executed directly, it can be done by making the association between the file extension .Pl and perl programs. So every file ending pl will executed by perl programs, precisely active perl

MAKE PERL SCRIPT “HELLO WORLD”
Perl script is a text file that consists of a set of commands perl. Here are some general provisions to note:

  1. Empty spaces at the beginning of the line will be ignored
  2. Perl command terminated with semicolon or a semicolon “;”
  3. Fence or a sign “#” will be defined as where the comment behind will be ignored
  4. On Unix systems, the first line of the program included the location of perl, for example #! / Usr / local / bin / perl

Well, you see the program first, hello world!

#! / usr / local / bin / perl
# Name of Program: hello.pl
print “Hello World \ n”;

let’s do the following steps:

$ Perl hello.pl
Hello world

Or

$ Chmod + x hello.pl
$ Hello.pl
Hello world
$

TYPE DATA

There are several main types of data types, namely:

Scalar
* Array
* Assosiatif array (array continued)