ݺߣ

ݺߣShare a Scribd company logo
Perl Seminar
Perl Seminar
Perl Seminar
   by
What is Perl?
What is Perl?
What is Perl?
How to program it?
How to program it?


  Just type “perl”
How to program it?
How to program it?
How to program it?


       or
How to program it?
How to program it?
How to program it?



  Make “.pl” file
How to program it?
How to program it?
How to program it?


       or
How to program it?
How to program it?
How to program it?



#!/usr/bin/env perl
How to program it?
How to program it?
How to program it?


       AND
How to program it?
How to program it?
How to program it?


      Run !
How to program it?
Hell o World!
Hello, World!
Hello, World!
Hello, World!


print “Hello, ´ǰ!”;
Hello, World!
Basic 1 : Variable
Basic 1-1 : Normal Variable
Basic 1-1 : Normal Variable
Basic 1-1 : Normal Variable


           : $VariableName
Basic 1-1 : Normal Variable


              : $VariableName
         or       or
Basic 1-1 : Normal Variable
Basic 1 : Variable
Basic 1-2 : Array Variable
Basic 1-2 : Array Variable



         : @VariableName
Basic 1-2 : Array Variable



          : @VariableName
   $#VariableName :
Basic 1-2 : Array Variable



          : @VariableName
   $#VariableName :
  $VariableName[n] : n
Basic 1-2 : Array Variable
Basic 1 : Variable
Basic 1-3 : Hash Variable




         (        )
Basic 1-3 : Hash Variable


 (        ) : %VariableName
Basic 1-3 : Hash Variable


 (          ) : %VariableName
$VariableName{key} : key   value
Basic 1-3 : Hash Variable
Basic 1 : Variable
Basic 1-4 : Temp Variable
Basic 1-4 : Temp Variable


               : $_
Basic 1-4 : Temp Variable
Basic 2 : Operator
Basic 2-1 : Numeric Operator
Basic 2-1 : Numeric Operator




      +
Basic 2-1 : Numeric Operator




      + -
Basic 2-1 : Numeric Operator




      + - *
Basic 2-1 : Numeric Operator




      + - * /
Basic 2-1 : Numeric Operator




      + - * /
                            t Ba sic!
                   t is jus
                  I
Basic 2-1 : Numeric Operator




      + - * /
Basic 2-1 : Numeric Operator




  += -= *= /=
Basic 2-1 : Numeric Operator




  += -= *= /=
                              ad d =
                      Jus t
Basic 2-1 : Numeric Operator
Basic 2-1 : Numeric Operator
Basic 2-1 : Numeric Operator


      == != <
      > <= >=
Basic 2-1 : Numeric Operator
Basic 2 : Operator
Basic 2-2 : String Operator
Basic 2-2 : String Operator




        .
Basic 2-2 : String Operator

            J OIN




        .
Basic 2-2 : String Operator

            J OIN




        .           x
Basic 2-2 : String Operator

            J OIN




        .           x
                        REPEAT!
Basic 2-2 : String Operator
Basic 2-2 : String Operator
Basic 2-2 : String Operator

   eq ne lt
   gt le ge
Basic 2-2 : String Operator
Basic 3 : Loop
Basic 3-1 : For
Basic 3-1-1 : Normal For
Basic 3-1-1 : Normal For

    for(Init; Cond; Inc) {
      # Something Todo
    }
Basic 3-1-1 : Normal For
Basic 3-1 : For
Basic 3-1-2 : Foreach
Basic 3-1-2 : Foreach

  foreach(List) {
    # Something Todo
  }
Basic 3-1-2 : Foreach
Basic 3-1-2 : Foreach
Basic 3-1-2 : Foreach

  for(List) {
    # Something Todo
  }
Basic 3-1-2 : Foreach
Basic 3-1-2 : Foreach
Basic 3-1-2 : Foreach

  foreach $Value (List) {
    # Something Todo
  }
Basic 3-1-2 : Foreach
Basic 3-2 : While
Basic 3-2 : While

while(condition) {
  # something to do
}
Basic 4 : Subroutine
Basic 4-1 : Subroutine?
Basic 4 : Subroutine
Basic 4-2 : definition

       sub NAME {

       }
Basic 4 : Subroutine
Basic 4-3 : Usage


 NAME(ARG1, ARG2, ARG3);
Basic 5 : I/O
Basic 5-1 : File I/O
Basic 5-1 : File I/O


open(HANDLE, < or > or >>, FILENAME)
Basic 5-1 : File I/O


open(HANDLE, < or > or >>, FILENAME)
          Input: <HANDLE>;
Basic 5-1 : File I/O


open(HANDLE, < or > or >>, FILENAME)
          Input: <HANDLE>;
 Output: print DESTINATION SOURCE;
Basic 5-1 : File I/O


open(HANDLE, < or > or >>, FILENAME)
          Input: <HANDLE>;
 Output: print DESTINATION SOURCE;
           close HANDLE;
Basic 5 : I/O
Basic 5-2 : Console I/O
Basic 5-2 : Console I/O


     Input: <STDIN>;
Basic 5-2 : Console I/O


     Input: <STDIN>;
      Output: print;
Basic 5-2 : Console I/O


     Input: <STDIN>;
      Output: print;
    ReadMode 'noecho';
Basic 6 : ARGUMENTS
Basic 6 : ARGUMENTS
Basic 6 : ARGUMENTS


 @_
Basic 6 : ARGUMENTS


 @_    @ARGV
Basic 6 : ARGUMENTS


 @_    @ARGV   shift

More Related Content

ʱ세미나