Austin Guthals Comp 232 Prof. Melara 12/13/1999 Perl, a Scripting Language Perl was created under strange circumstances, it was never intended to be a widely used public language but the features it provided caused many programmers to crave for more. Larry Wall initially created Perl to produce reports from a “Usenet- news-like hierarchy of files for a bug-reporting system.” 1 Apparently awk and sed could not handle the task. Larry decided to fix this problem with a C application now known as Perl, Practical Extraction and Report Language. Perl grew at the same rate as the UNIX operating system. It became portable as new features were added. Perl now has extensive documentation available in different man pages. Perl is growing now just as every widely used programming language. Perl is known for its management of data. It can manipulate files and directories and manage tasks. It can easily analyze results from other applications including sorting large files that would take a human a long time. Perl is generally used for its scripting abilities. String manipulation is much smoother using Perl than using imperative languages like Java and C. The data representation of numeric data in Perl is a little different than other languages. All numeric data is a double precision floating point value in Perl. For this reason it would not be a good idea to solve complex mathematical problems with Perl because it would be much slower than using a regular imperative language. String values are sequences of characters as in most other languages. The convention for scalar variable identifiers is a dollar sign followed by a character followed by a sequence of underscores and alphanumeric values. Scalar variables can contain a single value representing a number, string, or reference. For example “$a = “hello”” is just as valid as “$b1 = 3.4”. Perl has numerous built in functions and it allows for user defined subprograms. Subprograms are an example of data abstraction. To define a subprogram you use the convention if “sub subname { statements; }”. To pass parameters you call subname(arg1, arg2). To access the parameters is a little different, you must get the values from the temporary @_ array. The @_ array is private to the subprogram. Subprograms can return variables and can have their own private variables. Perl can have input from files and keyboards and can have output to files and screens. There is an ever-growing library of functions in Perl. The way that arrays can hold numeric data and strings without much hassle is convenient. The ease with at which strings and large amounts of data can be manipulated is the main strength of Perl. There are some problems with Perl as there are with all artificial languages. One is that Perl can be write-only, which means it is not easily read by anyone. If good variable names and comments are used then this problem can be overcome. Perl is not a language for every problem but the designers try to make it seem that way. Perl is not the best language to use when it comes to computing numbers because integers are non-existent. It takes much longer to process the addition of two double precision values than it does to execute the addition of two integers. 1. Randal Shwartz L. and Tom Christiansen. LEARNING PERL, SECOND EDITION. Sebastopol, CA: O’Reilly & Associates, Inc. 1993, p. 1. Works Cited Shwartz, Randal L. and Tom Christiansen. LEARNIG PERL, SECOND EDITION. Sebastopol, CA: O’Reilly & Associates, Inc. 1993.