Tag Archives: Ubuntu

Menjalankan Script Perl di Ubuntu

Menjalankan Perl di Ubuntu

Ubuntu Dekstop

Ubuntu Dekstop

PERL is stand for Practical Extraction and Report Language. PERL was created by Larry Wall in 1987, it is use in Linux for processing ASCII format. It was designed as quick patch program UNIX. This language  is very simple, offering optimum flexibility, perfect for short and straight forward scripting. 

This below are some step before we write PERL.

1. To get start PERL, we can write in a simple editor.

2. Check first the PERL in your UBUNTU, it can be check be type perl -v.

     if there no PERL, you can easy install it by type sudo apt-get install perl.

3. After finish installation, now you are ready to write your first perl script.

4. Try to write like this below example.

    a. Make file that has name test.pl (remember write ” .pl”  for the extension file)

    b. write the content of the file with this below script.

      #!/usr/bin/perl
      # Program Perl Percobaan Pertama
            print (“Puji Tuhan…, type an input keyboard :\n”);
            $inputline=<stdin>;
       # <stdin> function as input if in C language we can use scanf,,.. :p
             print ($inputline);

     c. and then save

5. After you save the file then change mode of the file into executable file.

    type chmod +x test.pl

6. Then type perl <file name>

     type perl test.pl

Hope this article give something little understanding for all of us 🙂

Ciayo…..GBU

.

 

Skip to toolbar