Basic Perl Programming
หลักสูตร Basic Perl Programming เป็นการอบรมพื้นฐานภาษา Perl ทั้ง Scalars, Arrays, Hashes, Control Flow, I/O, Subroutines และ Packages ไปจนถึง CGI Programming, Networking และการเขียนเชิงวัตถุ เพื่อนำไปสร้างเว็บแอปพลิเคชัน เหมาะกับนักพัฒนาระบบและผู้ที่มีประสบการณ์ภาษา C หรือ Unix Shell
- ระยะเวลา24 ชั่วโมง · 4 วัน
- รูปแบบออนไซต์ / ออนไลน์สด
- รอบถัดไปเปิดตามคำขอ
- ใบรับรองมี Certificate
ภาพรวมหลักสูตร

สิ่งที่คุณจะได้รับ
- รู้จักกับ Perl และใช้งานพื้นฐานได้
- ประยุกต์ใช้งาน Perl กับเว็บแอพพลิเคชั่นต่างๆ
- นำ Perl ไปสร้างเว็บแอพพลิเคชั่นที่มีประสิทธิภาพได้
หลักสูตรนี้เหมาะสำหรับ
- ผู้พัฒนาระบบ
- ผู้บริหารงานเว็บ
- หรือบุคคลที่สนใจการพัฒนาโปรแกรมด้วย Perl
พื้นฐานของผู้เข้าอบรม
- มีความรู้ในงานคอมพิวเตอร์อย่างดี
- มีความเข้าใจระบบปฏิบัติการ Windows อย่างดี
- มีพื้นฐานการเขียนโปรแกรมอย่างดี
- มีประสบการณ์ในการเขียนภาษา C หรือเชลล์ใน Unix
หัวข้อการฝึกอบรม
ภาพรวมหลักสูตร
- รู้จักการเขียนโปรแกรม Perl
- การจัดการไฟล์ และไดเรคทรอรี่
- การใช้ความสามารถของ Regular Expression
- การสร้าง awk เป็นรายงาน
- การแก้ปัญหาโดยใช้ array
- การนำข้อดีของ Perl ไปใช้กับ UNIX และระบบปฏิบัติการอื่นๆ
- การทำงานกับระบบสื่อสาร และการใช้งานผ่าน CGI
- การแสดงหน้าที่ในการบริหารระบบ
- การใช้ Perl ในการเขียน CGI applications
- การเขียนเป็นโมดูลจากมาตรฐาน Perl
- การใช้โครงสร้างข้อมูล และการอ้างข้อมูลของ Perl
- การสร้าง Object ใน Perl
- การสร้างออปเจค และการนำกลับมาใช้
เนื้อหาหลักสูตร
Module 1 Introduction Perl Programming
- What is Perl?
- Installing ActiveState's ActivePerl on Windows
- Installing Eclipse on Windows
- Installing Eclipse on Mac
Module 2 Perl Quick-Start Guide for Experienced Programmers
- Hello World
- Counting lines in a file
- Using a loop in Perl
- Using subroutines in Perl
- Using Perl's documentation
Module 3 General Syntax
- Understanding how Perl uses whitespace
- Terminating statements with semicolons
- Creating comments
- Best practices for formatting code
Module 4 Variables and Values
- Understanding values and variables
- Declaring numeric variables
- Declaring character string variables
- Declaring lists and array
- Pulling slices from arrays
- Understanding hashes and associative arrays
- Getting value pairs using the each function
- Understanding the undef value
Module 5 Statements and Blocks
- Assigning values to variables
- Using statements and expressions
- Combining statements into blocks
- Understanding scope
Module 6 Conditional Statements
- Understanding conditional statements
- Creating conditionals with if
- Extending conditionals with else
- Extending conditionals with elsif
- Building if statements with postfix conditionals
- Creating negative conditionals with unless
- Using the ternary conditional operator
Module 7 Loops
- Understanding loops
- Creating loops with while
- Creating loops with until
- Iterating lists with foreach
- Iterating lists with for
- Using loop control statements
- Building loops with postfix statements
Module 8 Special Variables
- Understanding special variables
- Using special variables
- Working with special file handles
- Using special constants
Module 9 Operators
- Performing basic math with arithmetic operators
- Creating conditionals with comparison operators
- Combining conditionals with logical operators
- Reading file metadata with file test operators
- Creating a sequence with the range operator
- Combining strings with the concatenation operator
- Streamlining strings with quote operators
- Understanding operator precedence
Module 10 Regular Expressions
- Understanding regular expressions
- Searching and replacing text with regular expressions
- Extracting matches with parentheses
- Matching wildcards
- Matching classes of characters
- Creating arrays with split
Module 11 Subroutines
- Understanding subroutines
- Defining and calling subroutines
- Using arguments with subroutines
- Understanding scope and "my" variables
- Returning values from a subroutine
Module 12 References and Data Structures
- Understanding values and references
- Defining array references
- Defining hash references
- Building mixed data structures
Module 13 File I/O
- Understanding streams and files
- Using file handles
- Using the object-oriented interface for handling files
- Working with binary files
Module 14 Built-In Functions
- Manipulating strings with built-in functions
- Working with numbers
- Manipulating lists and arrays with built-in functions
- Retrieving and formatting time
Module 15 Modules
- Leveraging code with modules
- Understanding object-oriented and procedural modules
- Creating modules
- Understanding object and instance data
- Installing modules from CPAN on Mac and Unix
- Installing modules from CPAN on Windows
Module 16 Documentation with POD
- Understanding POD
- Documenting with POD
- Exploring a POD document
Module 17 New Features in Perl
- Using Perl
- Displaying text with say
- Selecting from multiple choices with given and when
- Keeping persistent variables with state
Module 18 Exploring Web Development
- Exploring CGI
- Using a database
- Developing a module library
Module 19 Conclusion and Exercise
- Exercise and Exam
รอบอบรมและรูปแบบการอบรม
สำหรับบุคคล — รอบอบรมทั่วไป
ขณะนี้ยังไม่มีรอบอบรมเปิดรับสมัคร ลงชื่อจองไว้ได้เลย ทีมงานจะติดต่อกลับเป็นกลุ่มแรกเมื่อเปิดรอบถัดไป หรือสอบถามทางไลน์ หรือโทร 02-570-8449 หรือ 088-807-9770
สำหรับองค์กร — In-house / Private Training
- ปรับเนื้อหาให้ตรงกับเครื่องมือและงานจริงของทีม
- เลือกวันเอง อบรมที่บริษัทหรือออนไลน์สด
- ออกใบเสนอราคาในนามนิติบุคคลให้ฝ่ายจัดซื้อ
วิทยากรผู้สอน
คำถามที่พบบ่อย
ใช้ Regular Expression ใน Perl ค้นหาและแทนที่ข้อความอย่างไร
Perl มี Regular Expression อยู่ในตัวภาษา ใช้ตัวดำเนินการ =~ กับ m// เพื่อค้นหารูปแบบ เช่น if ($line =~ /error/i) ตรวจว่ามีคำว่า error โดยไม่สนตัวพิมพ์ใหญ่เล็ก และใช้ s/// เพื่อแทนที่ข้อความ เช่น s/\s+/ /g แทนช่องว่างหลายตัวด้วยช่องว่างเดียว ส่วนที่ครอบด้วยวงเล็บจะถูกจับเก็บไว้ในตัวแปร $1 $2 เพื่อนำไปใช้ต่อ
Array กับ Hash ใน Perl ต่างกันอย่างไร
Array ขึ้นต้นด้วยเครื่องหมาย @ เก็บรายการค่าเรียงตามลำดับ และเข้าถึงด้วยเลขตำแหน่งที่เริ่มจาก 0 เช่น $names[0] ส่วน Hash ขึ้นต้นด้วยเครื่องหมาย % เก็บข้อมูลเป็นคู่ key กับ value และเข้าถึงด้วย key เช่น $stock{'apple'} เหมาะกับการค้นหาหรือนับจำนวน ใช้ฟังก์ชัน keys หรือ each วนอ่านคู่ข้อมูลทั้งหมดใน Hash
อ่านไฟล์ทีละบรรทัดด้วย Perl ทำอย่างไร
เปิดไฟล์ด้วย open(my $fh, '<', 'data.txt') or die แล้ววนอ่านด้วย while (my $line = <$fh>) ซึ่งแต่ละรอบจะได้หนึ่งบรรทัด ใช้ chomp ตัดอักขระขึ้นบรรทัดใหม่ท้ายบรรทัดออก แล้วจึงประมวลผล เช่น นับบรรทัดหรือค้นหาคำด้วย Regular Expression เมื่ออ่านเสร็จให้ปิดไฟล์ด้วย close($fh)
หลักสูตร Basic Perl Programming เหมาะกับใคร ต้องมีพื้นฐานอะไรมาก่อน
เหมาะกับผู้พัฒนาระบบ ผู้ดูแลงานเว็บ และผู้ที่สนใจพัฒนาโปรแกรมด้วย Perl ควรใช้คอมพิวเตอร์และ Windows ได้ดี มีพื้นฐานการเขียนโปรแกรมที่แน่น และมีประสบการณ์เขียนภาษา C หรือ Shell บน Unix มาก่อน
เรียนจบหลักสูตร Basic Perl Programming แล้วทำอะไรได้บ้าง
เขียน Perl โดยใช้ Scalar Array Hash เงื่อนไข และลูป จัดการไฟล์และไดเรกทอรี ใช้ Regular Expression ประมวลผลข้อความและสร้างรายงาน เขียน Subroutine และ Package ใช้ Reference เขียนโปรแกรมเชิงวัตถุ และนำ Perl ไปสร้างเว็บแอปพลิเคชันผ่าน CGI ผู้ผ่านการอบรมได้รับใบประกาศนียบัตร (Certificate of Completion) ที่มีเลขที่ของตัวเองและตรวจสอบออนไลน์ได้
เรียน Basic Perl Programming ใช้โปรแกรมอะไรบ้าง
ใช้ ActivePerl ของ ActiveState เป็นตัวแปลภาษา Perl บน Windows และใช้ Eclipse เป็นโปรแกรมเขียนโค้ด โดยเนื้อหามีขั้นตอนติดตั้ง Eclipse ทั้งบน Windows และ Mac ในช่วงแรกของการอบรม ส่วนผู้ที่ใช้ Linux หรือ macOS โดยทั่วไปจะมี Perl ติดตั้งมากับระบบอยู่แล้ว
