Tuesday, September 3, 2019

Perl: A Popular Scripting Language :: Computers

Perl: A Popular 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.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.