280 likes | 412 Views
Introduction to Perl. Wayne Machuca CS133 PRL Mt Hood Community College. Perl Facts. Perl is a stable, cross platform programming language. It is used for mission critical projects in the public and private sectors.
E N D
Introduction to Perl Wayne Machuca CS133 PRL Mt Hood Community College CS133 PRL - Machuca
Perl Facts • Perl is a stable, cross platform programming language. • It is used for mission critical projects in the public and private sectors. • Perl is Open Source software, licensed under its Artistic License, or the GNU General Public License (GPL). • Perl was created by Larry Wall (as a dissertation project). From: The Perl Directory, http://www.perl.org/about.html CS133 PRL - Machuca
Perl Facts • Perl 1.0 was released to usenet's alt.comp.sources in 1987 • PC Magazine named Perl a finalist for its 1998 Technical Excellence Award in the Development Tool category. • Perl is listed in the Oxford English Dictionary. CS133 PRL - Machuca
Supported Operating Systems • Unix systems • Macintosh - (OS 7-9 and X) see The MacPerl Pages. • Windows - see ActiveState Tools Corp. • VMS • And many more... CS133 PRL - Machuca
Perl Features • Perl takes the best features from other languages, such as C, awk, sed, sh, and BASIC, among others. • Perl’s database integration interface (DBI) supports third-party databases including Oracle, Sybase, Postgres, MySQL and others. CS133 PRL - Machuca
Perl Features • Perl works with HTML, XML, and other mark-up languages. • Perl supports Unicode. • Perl is Y2K compliant. CS133 PRL - Machuca
Perl Features • Perl supports both procedural and object-oriented programming. • Perl interfaces with external C/C++ libraries through XS or SWIG. • Perl is extensible. There are over 500 third party modules available from the Comprehensive Perl Archive Network (CPAN). • The Perl interpreter can be embedded into other systems. CS133 PRL - Machuca
Perl and the Web • Perl is the most popular web programming language due to its text manipulation capabilities and rapid development cycle. • Perl is widely known as " the duct-tape of the Internet". • Perl's CGI.pm module, part of Perl's standard distribution, makes handling HTML forms simple. • Perl can handle encrypted Web data, including e-commerce transactions. CS133 PRL - Machuca
Perl and the Web • Perl can be embedded into web servers to speed up processing by as much as 2000%. • mod_perl allows the Apache web server to embed a Perl interpreter. • Perl's DBI package makes web-database integration easy. CS133 PRL - Machuca
Current Releases • The current stable release is 5.8.7 • The current development release is 5.9.2 • Perl 6 under development nowhttp://dev.perl.org/perl6/faq.html CS133 PRL - Machuca
Perl and the Internet CS133 PRL - Machuca
Perl and the Internet • Web pages communicate to user hosts from a web server using HTTP Network Host Server CS133 PRL - Machuca
Perl and the Internet • On an Intranet, hosts are close to servers, traffic is light and bandwidth is fast. • You can afford to use server-based software and dumb terminals LAN Thin Client Dumb Terminal Server CS133 PRL - Machuca
Perl and the Internet • On an Internet, hosts are distant from servers, traffic is very, very heavy and bandwidth is inconsistant. • You cannot afford to use server-based software and dumb terminals The Internet Cloud Intelligent Host Web Server Thick Client…… CS133 PRL - Machuca
Definitions • HTML – Hyper Text Markup Language • HTTP – Hyper Text Transfer Protocol • Static Web Page – Web page that does not change until the page’s author modifies it • Dynamic Web Page – Web page that changes with the user (not like a simple catalog site) CS133 PRL - Machuca
Web Languages • There are several languages that add dynamic capabilities to a web site • Visual languages (such as Visual Basic .NET) are “heavy” languages that require significant software to be downloaded on the host • Fine for LANs • Applications are installed on the host • Handles data access well CS133 PRL - Machuca
Web Languages • However, your typical web browsing user or a customer will balk at downloading a significant amount of “unknown” software simply to browse your web site. CS133 PRL - Machuca
Scripting Languages • Scripting Languages are basically stripped down versions of larger languages that are small and transmit quickly over the Internet • JavaScript is a reduced version of Java • VBScript is a reduced version of Visual Basic • The browser must be able to accept and translate the script language for the user to be able to use the functions on the web site CS133 PRL - Machuca
Server Side Scripting Languages • You have seen data entry forms on the Internet. • These programs will capture data from the screen and transmit it back to the server. • These programs execute on the web server and not in the Host’s browser. • Some popular server-side scripting languages include • CGI – Common Gateway Interface • ASP – Active Server Pages • JSP – Java Server Pages CS133 PRL - Machuca
CGI • Web pages communicate to user hosts from a web server using HTTP CGI Script HTTP CGI Protocol Web Server Host Browser Databases and other files CS133 PRL - Machuca
Using Perl at Mt Hood Subtleties to get you to success CS133 PRL - Machuca
What we have… • We will be using generic, vanilla Perl. • Initially, access Perl programs through DOS Command Line • Perl should be installed in the class and labs CS133 PRL - Machuca
How to check… CS133 PRL - Machuca
How to check 2 …Check the Path CS133 PRL - Machuca
You will need a storage device • You will need a flash drive • Perl applications are small but there will be many of them • 3.5” 1.44MB Floppy drives are being phased out here. CS133 PRL - Machuca
Editing in Notepad CS133 PRL - Machuca
What you will see CS133 PRL - Machuca