(the language for getting your job done) Internet Programming Diana Hingst
Dynamic programming language Intended to be practical (easy to use & efficient) Widely adopted for its text processing One of “The Three P’s” (Perl, PHP, Python) for writing web applications
File system manipulation Database administration Client-server programming Secure programming Object-oriented programming GUI development
Created by Larry Wall in 1987 Designed as a glue for Unix OS Originally named “PEARL” Figure 1: Larry Wall
First Edition published in 1991 as a reference guide to Perl. Previously, documentation was a single (very long) man page. Perl 4 released. Figure 2: Programming Perl Cover
Answer: Both 1. Compiles into an intermediate format Optimizes & gives instant feedback 2. Interprets the intermediate format to execute
#Comment $number = “4”; $string = “3 apples”; = (“couch”, “movie”, “drink”); %hash = (joe => ‘red’, sam => ‘blue’); $a ** $b#a^b $a. $b#String Concatenation $a x $b#Repeat a b times
$camels = ‘123’; print $camels + 1;# Prints 124 $a = “8”; print $a + “1”;# Prints 9 print $a. “1”;# Prints 81
Open a text editor Save with file extension.pl (or.cgi) We’ve located the PERL interpreter and told it we’re going to be working with a web browser or in a web environment
Upload it to your web server Run the program in one of three ways Link to it Click Here Write it into your HTML file Action item of a form Unix command line perl myscript.cgi
Perl Code HTML Code
Data Tracing Mechanism Automatically determines which data was derived from insecure sources Specially Protected Compartments Able to safely execute Perl code that may be dangerous/insecure
Rotate Banners Generate Text & HTML on the fly Set Cookies Provide Shopping Carts
Amazon.com LiveJournal.com Ticketmaster.com IMDb.com
Writing poems that can actually be compiled as legal Perl code. if ((light eq dark) && (dark eq light) && ($blaze_of_night{moon} == black_hole) && ($ravens_wing{bright} == $tin{bright})){ my $love = $you = $sin{darkness} + 1; };
Programming Perl 2 nd Edition pj html pj html