Performance and Tuning Adaptive Server Enterprise 16.0 Query Optimization...
- Introduction to Perl
- Perl History
- Perl Philosophy
- A scripting language
- Operating systems can do many things
- copy, move, create, delete, compare files
- execute programs, including compilers
- schedule activities, monitor processes, etc.
- A command-line interface gives you access to these functions, but only one at a time
- A scripting language is a “wrapper” language that integrates OS functions
Some Scripting Languages
- UNIX has sh, bash, ksh, csh, perl
- Macintosh has AppleScript, Frontier
- Windows does not have any scripting languages – probably due to weaknesses of DOS
- Generic scripting languages include:
- Perl (most popular)
- Python (Java-like, best for large programs)
- “Practical Extraction and Reporting Language”
- Written by Larry Wall and first released in 1987
- Perl has become a very large system of modules
- Name came first, then the acronym
- “Perl is a language for easily manipulating text, files and processes“
- -Originally aimed at systems administrators and developers
What is Perl?
- Perl is a High-level Scripting language
- Faster than sh or csh, slower than C
- No need for sed, awk, head, wc, tr, …
- Compiles at run-time
- Available for Unix, PC, Mac
- Best Regular Expressions on Earth
- 1986-87 – Perl was invented by Larry Wall at NASA’s Jet Propulsion Labs
- 1987-Dec Perl 1 introduced Perl to the world.
- 1988-Jun Perl 2 introduced Henry Spencer’s regular expression package.
- 1989-Oct Perl 3 introduced the ability to handle binary data.
- 1991-Mar Perl 4 introduced the first Camel book.
- 1994-Oct Perl 5 introduced everything else, (OOP, threads…)
- 2014-05-27 Perl 5.20 has been released by Ricardo Signes.
- Latest Version is 5.24
- TIMTOWTDI is pronounced “Tim Toady” and is:
- There is more than one way to do it
- Perl aims to be aggressively non-prescriptivist.
- Prescriptivism is the attitude or belief that one variety of a language is superior to others and should be promoted as such.
- Every problem should have multiple solutions.
Making easy things easy & hard things possible
- This quote comes from the front of Learning Perl, also known as the Llama.
- It goes hand-in-hand with TIMTOWTDI.
- Every problem has multiple solutions implies every problem has at least one solution 🙂
- Perl’s creator Larry Wall has a linguistics background, and took some of that with him when he designed Perl.
- Keywords such as “for”, “my”, “defined”, “say”, “do”, “while”, “if”, “unless”, and “use” all read quite nicely to English eyes as well as to programmer eyes.
- In many languages this is acceptable:
puts 4 + 2 # 6 puts “ram" + “n" # “ramn" puts “6" + 2 # `+': can't convert num into String In Perl we use different operators: say 1 + 2; # 3 say “R" . “N"; # “RN" say "2" + 1; # 3 say "2" . 1; # 21