Perl Training |
1-800-716-4324 |
|
San Francisco Bay Area Class Info for:
|
Introductory Perl - San Francisco
In this training course you will learn the fundamental concepts of programming in Perl as well as how to output a dynamically generated web page with Perl. We will introduce you to a great text editor to help develop your Perl programs and some other useful tools. By the end of the class, you will be able to create Perl scripts that ping other computers, generate directory listings, and download the source code of other web sites in order to extract current stock quotes. Downloading, Installing, and Running Perl Distributions of Perl exist for many different operating systems, including Mac, Windows, Unix, Linux, and many more. We will show you where to find the right version of Perl to download. After installing it, you will find several folders relating to documentation, extra code, examples, and tools; we will explain what each of these is for. You can instruct Perl to wait for you to type commands, or you can have it interpret an existing file full of Perl instructions. We will show you the nuances of getting Perl scripts to run on Windows and Unix. For the rest of the class we will use ActiveState's distribution of Perl and its Perl code editor. Variables, Comments, and Syntax Perl is a loosely-typed language, meaning that variables are not specifically designated as dates, numbers, letters and such. We'll show you the basic syntax of Perl and how to assign character and numeric values to Perl variables. You'll also learn how to adequately comment your code. Operators and Functions for String and Numeric Variables Once you have a variable -- representing a word or sentence (known as a "string variable"), or perhaps representing a sales figure or expense (numeric variables) -- you can perform various operations on them. Simple operations include concatenating strings, and arithmetic operations applied to numeric variables. In addition to these operations, specific functions in Perl allow the programmer to further manipulate variables. In the case of string variables, programmers can use Perl functions to perform find/replacements, substring extractions, and letter-counts. In the case of numeric variables, programmers can use Perl functions to calculate square roots, logarithms, sines, cosines, truncations, and the like. This section of the training will show you how to output formatted text and variable values using the print() function, and the differences between printing multiple values and complex expressions. Escaping Special Characters Printing text output from your script would be straightforward except that Perl interprets several "special characters" differently from their normal uses. For example, dollar signs ($) and at-symbols (@) are special characters that, when printed, output variable values, not the actual special character itself. Similarly, certain character combinations starting with the backslash (\) special character designate tabs and newlines. You will see the special rules by which Perl evaluates string variables -- whether enclosed in double quotes, single quotes, or prefixed with a backslash. Integrating Operating System Commands One powerful feature of Perl that is easy to implement is its integration with operating system commands. For example, it is easy to take the result of a DOS "ping" or "dir" command and stick it in a Perl variable for processing. This part of the training will show you how to run DOS and Unix system commands from within Perl and store the results in a variable. We will also demonstrate how, with the right system command and combination of Perl processing, you can dynamically retrieve any company stock quote from financial services web sites such as Yahoo! Finance. If-Else Conditionals Conditionals allow the programmer to direct the path of execution of code depending on whether certain conditions are met. Perl conditionals are very similar to their counterparts in the Java, JavaScript and C/C++ languages. This training will show you how to test if string or numeric variables are equal to particular values and if so, execute a specific block of code. You will also see how to use the logical operators ("and" and "or") to determine if one of several conditions is true, or if more than one condition is true. Looping Structures Perl has several looping constructs that allow the code to iterate through a set of instructions. You will see examples of the two most common: "while" and "for" loops. In the sample above, we use a loop to iterate over instructions that output a horizontal line whose width varies according to a trigonometric function, producing a sine wave. For a typical loop, see this example of a sine wave Perl on Unix Executing Perl scripts on Unix is a little bit different from Windows. We will first show you how to use a simple Unix text editor to create an executable script. Then we will turn it into an executable Perl script. Using Modules for Specific Tasks Perl comes with many built-in "modules" that allow you to perform specific tasks such as creating graphics files, sending emails, and administering your system. In this section we illustrate how to use the easiest of these modules to enhance your scripts. Prerequisites:
keywords: perl classes san francisco bay area (Perl Intermediate), perl course san francisco bay area (Perl Advanced) |
Newsletter subscribers can win $100 credit!
Home | Course Catalog | Schedule | About Us | Contact Us | Extras | Sitemap | Package Rates | Shopcart