The important value of Perl language is reflected

xiaoxiao2021-03-06  43

Important value of Perl language Reflect: Klaus Source: China Perl Association FPC (Foundation of Perlchina) Original: The Importance of Perl Original: http://www.perl.com/pub/a/oreilly/perl/news/importance_0498. HTML Perlchina reminds you: Please protect the author's copyright and maintain the crystallization of the author. Although the media is so paying attention to Java and Activex, it should be "let the Internet live" should be Perl, and a professional and technical analyst is invisible, but it appears in all network administrators, system administrators or programmers. Language. The daily work includes establishing a routine network application, or sticking different programs to achieve their designers do not have foreseen features. Sun's first network administrator Hassan Schroeder commented: "Perl is the conveyor belt / blood vessel of the Internet." Perl was originally a scripting language developed by Larry Wall to UNIX, with the purpose of using the UNIX Shell easy The powerful function of sex and programming languages ​​(such as C) is combined with plasticity. Perl quickly became the language of UNIX system administrators. With the development of World Wide Web, Perl uses great expansion. The public gateway interface (CGI) provides a simple way to pass data between network servers and programs and use web pages. Perl rapidly became the main language of CGI programming. After the powerful WIN32 transplanted version, Perl also invaded and became one of the scripting languages ​​for the NT system, especially in system management, website management and programming. Once, in mainstream analysts believe that CGI programs and Perl will soon be replaced by Java, ActiveX, and other new technologies. However, they did not expect that Perl continued to grow, Microsoft's mod_perl's mod_perl's mod_pers supported directly on the server, as well as data interfaces such as DBI, Perl Database interface, for background The integration of the database and Perl provides a stable API. This article explores why Perl becomes more and more important, not limited to the network, but is a widely used computer language. These reasons include: * The scripting language such as Perl is different from the traditional program language such as Java, C or C. * Perl The ability to "adhere" together in many programs, or convert the output of a program into another program's input capabilities. * Perl has an unparalleled ability in processing text, such as powerful features such as regular expressions. This is especially important after the network text (HTML) renewed, it has become a network "diplomatic language" of all applications and systems. * Distributed development teams with an organic, evolutionary way, followed by rapid changes. A good scripting language should be a high-level software development language that can quickly develop gadgets, while having the form of workflow and data organization required to develop complex procedures. Execution speed must be fast. There must be efficient in calling system resources such as file operation, internal process communication, process control. A good scripting language should be able to run on all popular operating systems, suitable for information processing (free text format) and data processing (digital and binary data). It is to be inserted and scalable. Perl meets all the standards above.

Why / when is you using a scripting language? John OUSTERHOUT is powerful in his article, script: a high-level program language in the 21st century. "Script language like Perl and TCL represents a very different programming style with a system program language such as C or Java. Scripting language is designed to" adhere "application; they use non-type way to achieve ratio System program language is higher and faster application development. The improvement of computer speed and the mixing and change of various applications are making more important in future scripting languages. "OUSTERHOUT continued: Just we close two When the end of the Ten Century, the method of writing a program has a change in the process. This shift is a scripting language such as a system program language such as C and C to PERL or TCL. Although many people are in such a transition, few people realize that it has happened, less people understand why it occurs ... The scripting language is designed to complete different tasks different from the system program language, This has led to a fundamental difference between them. The design of the system program language is to establish a data structure and algorithm from the underlying, starting from the initial computer element such as memory unit. In contrast, the scripting language is designed to do "glue" work: They assume that there are already many effective components, and then connect them. The system program language uses a strict data type to control complexity, and the scripting language has no data type to facilitate connecting components and provides the ability to quickly develop applications. Scripting language and system programming are complementary, and they support them at the same time from the 1960s. However, some trends in the near future, such as faster computers, better scripting language, the importance of graphical user interface, and component architecture, and the development of the Internet, making the application of scripting languages ​​greatly expand. The scripting language will have more and more applications, and the system envoys are mainly used to develop various components, and this trend will continue in next decade. System administrators are people who earliest using scripting languages. This problem exists in any operating system. It is generally to automatically complete some repetitive work. Even if the Macintosh system also requires some user-defined auto operations. Tasks may be simple, such as automatic backup and recovery systems, or complicated, such as all files on the hard disk, or store all system settings within twenty-four hours. Sometimes there is already a tool that can do this, but automatic operation requires a control program to launch them, extract and transform their output, and coordinate the work of these programs. Many systems have a built-in scripting language, such as VMS DCI, MS-DOS BAT file, UNIX's shell script, IBM REXX, Windows Visual Basic And Visual Basic for Applications, and AppleScripts are dedicated to some kind Good example of scripting language. Perl's unique lies in he breaking the tight connection between a scripting and an operating system, which has become a scripting language widely used under multiple platforms. Some scripting languages, especially Perl and Visual Basic, or are widely used as multi-purpose languages, or count TCL and Python. Successful scripting language is a long place that they easily call operating system functions / services. A higher level, as a multi-purpose scripting language, they must be steady to you can use their extent to which complex applications are written. The scripting language can be used to write prototypes, modeling, and testing, but when the scripting language is running quickly and robust, the prototype is directly an application. So why don't you use those multi-purpose program languages ​​such as C, C or Java alternative scripting languages? The answer is simple: cost. Development time is more expensive than hardware and memory.

The script language is easy to learn and it is easy to use. As OUSTERHOUT is pointed out, the scripting language usually does not have any data type concept. The script does not distinguish the integer and floating point, and the variable is not type. This is one of the reason why the scripting language is good at rapid development. The big profile is "no need to process details". Because scripting languages ​​are good at calling system tools to do difficult things (such as copy files and settles or folders), the details that have not been implemented can be handled by compile language. What is the use of data types for compiled languages? It makes memory management easier, but it is more difficult for programmers. Think about it: How much is a programmer earned when Fortran is popular? How much is the memory value? And what? The times changed. Cheap memory, programmers are very expensive! System language must write anything, which makes it easier to compile complex data structures, but programmers are more difficult to write. The scripting language is as much as possible to make a hypothesis, as little as possible, as little as possible. This makes the scripting language easier to learn, and it is faster. Its cost is difficult to write complex data structures and algorithms. However, Perl is done very well in complex data structure and algorithm, and it has not sacrificed simplicity of the simple program. Explaining the language and compile language Most scripting languages ​​are interpreted languages, which feels like not suitable for large program projects. This kind of saying should be corrected. Indeed, in addition to some hardware-specific languages, the interpretation language program is slower than the compiled language. The advantage of the interpretation language is that the program it written can run on any system that the interpreter can install. The interpreter is responsible for handling the specific details of the system, not the application itself. (Of course, there are also exceptions. For example, this app may call an uncommon system feature) Operating system command interpreter such as MS-DOS Command.com and early versions of Unix C shell is a good example of the interpreter run: One of the commands in the script is fed to the interpreter. The maximum impact is the loop: Each command in the loop reinterprets every time you run. Some people think that all interpretation languages ​​are so ... slow, inefficient, one line. But the fact is not the case. In fact, there are some intermediate languages, and it is compiled into certain intermediate codes when running, and then loads running by the interpreter. Java is an example, which makes it a very valuable cross-platform language. All Java interpreters on different hardware can communicate and share data and process resources. This is very great for embedded systems because the embedding system is actually a special purpose hardware. However, Java is not a scripting language. It requires a data declaration and is pre-compiled. (Unless you are compiling real-time compilation - although it is actually generating code) Perl is also an intermediate language. The Perl code is compiled as needed, and the different is the compiled executable portion is present in memory rather than a file. Any PERL code block is only compiled once. Perl's advantage in design makes all these optimizations worth it. Perl retains the removal of the language of the language and has the execution speed close to the compile language. I have already experienced a ten-year history of Perl, with hundreds of thousands of developers, now I will experience its five-way back to exchange bones, it is running simple and fast. Although there may be some delays when starting, because some time compiled code, this is very short relative to the time of code. Moreover, techniques such as "FAST CGI" can preserve repeated script mirror reserved in memory to avoid starting delays, unless this script is the first time. Anyway, Perl 5.005 will have a compiler written by Oxford University's Malcolm Beattie. This compiler will eliminate the latency latency during the compilation process and add some small acceleration technology. It also eliminates some of the physiological fear of scripting languages ​​to scripting languages.

(After using the compiler, others will not be able to see the source code) The information processing and data processing Internet is only one of our many huge variations in the form of computer. This change can be seen in our respect of the industry. It is called "data processing", such as: "If I want to get the result of the data processing at noon, I have to submit things to the data center in the morning." Now we call it "information service "For example," The head of the information service department is working together with our Planning Commission. " Interests and focus are now in "information" instead of "data". Obviously, we are now more concerned about information, while information often includes text and data, not just data. Perl is excellent in processing information. A large part of the Perl processing information is derived from a special syntax called regular expressions. Regular expressions give the ability to perform PERL extremely handling and operation of free text. Other languages ​​also support regular expressions, (Java even has a free / free regular expression library), but there is no such a better combination like Perl. For many years, the total trend has always been integrated into special application file formats. Only UNIX, define the ASCII text as a unified program file exchange format, while other systems make incompatible file formats more and more. It is a sharp turn to this trend. It is the Internet. Its HTML data format is composed of marked ASCII text. Due to the importance of the Internet, HTML- and ASCII text accompanying it - now in the central status of the data exchange format, almost all applications can output it. Microsoft even plans to provide a desktop of HTML. HTML's successor, XML (Scalable Markup Language) has now been widely believed to be a standard file exchange format in the mixed environment. HTML has strong significantly enhances the power of Perl. It is an ideal language, whether in verifying the user input in the HTML form, operate a large number of HTML content, or to extract and analyze the various / massive log files. This is just an aspect of the power of Perl processing text. Perl not only gives you a lot of ways to break down data, but also gives you a number of ways to stick back. Therefore, Perl is also ideal in processing information flow and reassembling. The information can be easily converted to another program or make an analysis summary. Some people say that the next generation application will not be the sample of these programs, but "Informatization Applications", where the text will constitute most of the user interface. Imagine a typical enterprise internal network application system: a human resources system, employee to choose which public foundation to invest in their pensions, readily understand the number of their accounts, and obtain the corresponding information to help them invest. The interface of this system will contain many information-based documents (usually in the form of HTML), some table-based simple CGI programs, and links to the background real-time stock market system (probably an internet service). Establishing such a system using traditional programming technology is very unrealistic. Any company's investment strategy will have different, and the huge amount of work of traditional programming technology investment cannot be returned in such a limitable project. Use the Web as a front desk, use the Perl script to complete the task link to the background database, you may not need to complete such a system for many times. Or let's take a look at Amazon.com, it may be an example of the most successful new network economy. Amazon offers an information front desk, as well as a background database and order system, then - you guessed - use Perl to connect them together. Perl's link to the database is supported by a set of powerful database independent interfaces, which are called DBIs. Perl FAST-CGI DBI may be the most widely used database link / connection system on the Internet. The ODBC module can also provide similar functions.

Considering the powerful foreground text processing capability of Perl, as well as the background database link function, you should start to understand why Perl will play an increasingly important role in a new generation of informationization applications. Perl's mode matching and processing features include biomedical research, as well as data mining. Any large text database analyzes the gene sequence from the human genome program to some big websites log file analysis, can be processed with Perl. The final Perl is further used to do network-based R & D and dedicated Internet search applications. The advantages of pattern matching and network socket development becomes the cornerstone of the Internet communication, which also makes Perl become the best language for the establishment of the network robot, which is used to find critical information on the Internet. Perl is used to develop application developers increasingly realizing that Perl acts as an application development language. Perl makes the traditional language that cannot be done. Not just because Perl development is simple, it can also be complex enough, and even use the most advanced object-oriented language technology when needed. Perl is simpler than C or C when preparing Socket-based client-server applications. Writing a free text handler with Perl is simpler than any language. Perl has a mature debugger written by Perl, and many options can be used to establish a secure application. Almost any suitable apps have a free Perl module that can be loaded when needed. Perl can easily expand with functions written by compiled C / C or even Java. This indicates that there are also functions or system services written by PERL. This expansion capability becomes more valuable because of the special functions of this system can be called under non-UNIX systems. Perl can also be called in the compiler or inserted into a program written in other languages. People are building a standard way, integrating Perl into Java, that is, Java classes will be able to write with Perl. So far, these programs require embedded Perl interpreters. However, 1997 fourth quarter O'Reilly & associates' Perl Resource Toolbox contains a new background compiler to compile Perl as Java bytecod to solve this problem. The graphical interface is developed by Perl is developed under UNIX system. This is probably considered to be a characteristic in the world of the graphical interface of today. Perl uses the extension module to create a program of the graphical interface. The most widely used is TK, in fact, it is a graphics toolkit developed for TCL scripting language, but it is quickly transferred to Perl. TCL is still focusing on the X-Window system, although she has begun to be transferred to Microsoft's Windows system. However, as mentioned above, the development of the inherent graphics interface has become less important because the Web is gradually become a graphical interface of most application standards. "Webtop" is a common cross-platform application that is rapidly replacing "Desktop". As long as you write a "webtop", you can use the Unix, Mac, Windows / NT, Windows / 95 ... any of the system with a web browser. In fact, more and more websites use Perl and Web to create simpler and easy interfaces for some traditional programs. For example, the Purdue University Network Computing Center designed a web interface for thirty circuit simulation tools, extracts data from the user fills from the user and converts to the command line, and sends a program connected to the HUB. Multithreading threads are a good solution for parallel processing, especially when you write two-way communication or event-driven programs. Earlier 1997 Perl already has a multi-threaded patch. When Perl5.005 appeared in the fourth quarter of 1997, it will be integrated into the standard release. The multitasking model that Perl has been supporting is "fork" and "waiting".

The smallest scheduling unit is a process, which is suitable for UNIX. The multi-threaded mechanism of Windows / NT is not the same, so the transagoyability of Perl is currently limited. However, if the abstract layer is established between process control and other applications, the problem is solved. Moreover, the work of the process control code of the Unix and Win32 system Perl interface is underway, and the fourth quarter of 1997 will be completed. Perl 6 years on Win32 system, Microsoft commissioned ActiveWare Network (current ActiveState) created a Perl and Win32 system interface for NT repository. This graft version can now be seen everywhere, it is said that nearly half the Perl source code download is used on the Win32 platform. Perl enters a Win32 platform like NT, there are many reasons. Although there is Visual Basic and Visual Basic for APLLICATIONS, the scripting language support on the Win32 platform is still relatively weak. Although VB is an interpreted scripting language, it is still a type of language that is used cumbersome. And it doesn't have a strong string processing capability like Perl. When establishing a large NT site, the system administrators appreciate the limitations of the graphical user interface, which is necessary for the management of hundreds of computers. Many times there is this situation, some experienced system administrators often call those sites that do not use the UNIX system, then use Perl to bring UNIX's advantages to other systems to other systems. You can't underestimate the impact of the Web. There are thousands of CGI programs and site management tools written in PERL now, supporting Perl is required for any server platform. For Microsoft's NT servers, O'Reilly and Netscape are more important, and support for Perl is necessary. ActiveState's PerlscriptTM allows Perl to run on a dynamic script engine that supports ASP's NT web servers such as Microsoft IIS and O'Reilly's Website. In addition to the core Perl language interpreter, the Win32TM interface of ActiveState Perl also includes a module that is specifically for Win32 environments. For example, it provides full support for automatic operation objects. With more and more Windows system resources and components support Perl port, Win32 version of Perl will be able to use more and more system functions. Extending Perl's power and Microsoft's Visual Basic or Sun's Java, Perl does not have a huge company to support it. Perl was originally developed by Larry Wall and was released as free software. Larry later developed Perl's job through a mail group, with the help of about two hundred partners, this mail group is called Perl5- Porters. Initially, this mailing group was established to push Perl to other platforms, but in the end it became the aggregation of contributors developing Perl core code. Perl5 adds an extension mechanism that can be dynamically loaded into the Perl program using this mechanism. This has led to the development of hundreds of additional modules, many of which have now become part of the Perl standard release. Additional modules can be obtained on a Composite Perl Archive Network (CPAN). The best entry of the CPAN is probably www.perl.com, where many book reviews, articles, and other PERL programmers and users are concerned about. Over the past, some prejudice used to use free software, now they have been smashed, because people have realized that there are many most significant computer technological breakthroughs in the past years are generated from the free software community. Internet itself is largely a cooperative free software project, and its development is also guided by those spontaneous developers who have spontaneous organizations.

Similarly, a large market in the web server platform is Apache, which is also a free software project, founded, expanded and managed by a large number of cooperative developer communities. In addition to continuous development, Perl communities provide active technical support through newsgroups and emails. There is also a technical support project for countless consultation and payment. Countless books offer excellent document materials, including the most famous. Programming Perl, the author is Larry Wall, Randal Schwarz and Tom Chirstiansen. The Perl Journal and www.perl.com provide information about some of the latest developments. In general, due to the traditional, Perl has the development and support resources comparable to the largest companies in the huge developer group and the free software community. The actual application case Next part includes an example of some user practical applications, from the highly familiar "Perl Save Today" story from the many system administrators, to some of the larger common applications. Some stories are from August 19-21, 1997, in San Jose, CA-held first Perl annual conference, and the procedure found on the progress of the meeting labeled the author's name. Case 1 - Save the programming language of Netscape Technical Support Dav Amann (Dove@Netscape.com), let's take a look at this situation. Your brand new network company has been fully launched, you have sold more browsers, servers, and web applications you imagine, your company's big step forward, the latest market survey shows that your customers have exceeded 300,000. The only annoying question now is that 30,000 guys who bought your browser may encounter something. They may not know where they have to go, they may want to find someone to help, they may want to find * you * to give them technical support. When this kind of thing happens, you will probably think: "Well, then I write some technical articles to the Internet." But you will find that you will find a content management system, one Publishing system, some log analysis, then collect and report feedback on your website, you should do this. Fortunately, you know Perl, then you use Perl to get everything in three months, just rely on four very busy technical support engineers some of the spare time. Case 2 - BYTE Site Snaphurger Treasure Conversion BYTE Magazine is ready to update its own information network and conference system, BIX, editing and readers can communicate various information. This conference system and usenet are very different, and the Mail-List is a bit image. But many byte's editing is used to using Usenet because they have been subscribing to the usenet. Therefore, Byte has built an interface that turns the discussion group inside the BYTE into the USENET system. The language used is Perl, which only has a few days and less than one hundred rows. Case 3 - Turning the needs of our customers to the right expert there is a world-leading computer company's performance test team wants to automate the navigation of user needs. They want to use the design of the company's internal network to solve this problem, but there is no funding budget. Two engineers who have only a few weeks of Perl programming solve this problem. Perl scripts automatically match the keywords of the query, then navigate them to the webpage of the experts they are looking for. This CGI program not only points to the expert page and E-mail address he wants to find, but also automatically sends his needs to the expert. This solution finally took only a few weeks, and saved a lot of budgets. Case 4 - Email Survey Collection and Analysis An Internet Market Survey company uses E-mail to do an investigation, and they want to automate the 10,000 reply. So Perl was also sent again.

Perl scripts produce the SPSS input result, although Perl itself can be used to do statistics, if this statistian will use Perl. Case 5 - Cross-platform evaluation system SPEC (Standard Performance Evaluation Association), an industrial association for assessing computer systems, making their evaluation system from SPEC92 to SPEC95, the main program has changed huge changes. They hope to make their system to run under the platform other than UNIX. The SPEC92 system is managed by UNIX shell and cannot be expanded. The SPEC95 system uses a portable and extended management engine written by Perl. This program takes advantage of the Object-oriented characteristics of Perl, and Perl's extension of C, and loads with Perl's dynamic modules. It is easy to transform the SPEC95 to the Windows / NT platform. The main difficulty in transplanting to the VMS system is that the VMS lacks the user-level fork method. Case 6 - Business consultants working with Perl Although I have been using C language for many years, I found no reason to continue to use it. Most of my work in ten years are acquisition, management and conversion information, not just data. The application I participated in the development is just the information acquisition, management and conversion system with a graphical interface. Perl is now competing than any other language, whether it is a scripting language or a system programming language. Although I started using Perl as a paste script and prototype language, now I have used it to do everything. It replaces my C and UNIX shell programs. Although in some cases, I may still need to use C language, but I hope that Java will eventually meet my needs. Cross-platform GUI interfaces are now doing well with HTML or locally, such as in the enterprise, or on the Internet. Perl provides a convenient data structural interface and an interface module of a commercial database. It provides me with system-level tools for process control, file management, and inter-process communication (as long as Socket exists). It allows me to create my programs with library, modules, packages, and subroutines, etc. It also allows me to write some programs that can modify their own, although it looks a little strange, but sometimes this is necessary. Perl gives me the biggest advantage that I only need one-fifth time to complete a complex task. This is very attractive for managers and customers, but most interested is those who pay for this. Case 7 - Perl as a rapid prototype language of flight data analysis Phil Brown, Mitre Company Higher Flight System R & D Center (philsie@crete.mitre.org) due to its robustness and plasticity, it has become a lot of programmers in CaasD Tools used to develop a fast prototype of a conceptual model. Traffic Flow Management Lab (T-LAB) has been using hundreds of Perl programs, from simple data boundaries and pilot drawings, to the complexity of the measurement space, and calculates the flight time in these areas. The size of these programs from 10 lines until 1200 lines. Because many of these programs use I / O high intensity, Perl is the most natural choice for completing these tasks due to their diverse parsing and search characteristics. Case 8 - Online Professional Print iPrint Discount Printing and Network Stationery Store (http://www.iprint.com) Using a web desktop publoquence that you see, directly connect to the background of the printer, and build it in a complex Real-time multi-function products and price database technology. Customers come to this website, established online, test and then customize customized printed items, such as business cards, letterhead, trademarks, stamps, and other things, especially some ads.

The iPrint system includes a front desk system (website) and a background process, eliminating all the pre-manual processes required by the printer, and provides all the required information for the IPRINT accounting system. 95% of this system is close to 80000 rows, using Perl V5.003, running on WindowsNT4.0. iPrint relies very dependent on the RDBMS (SQL server), and all the interactions of the server are done with Perl and ODBC. iPrint uses many CPAN modules including MIME and WIN32 :: ODBC. Case 9 - Amazon.com's Works Editing System Amazon.com enables Perl to develop a CGI-based editing work system, integrated writing (using Microsoft Word or Emacs), maintenance (CVS version control, and search using the Glimpse method), and Output (using a regular SGML tool) throughout the process. The author first uses the CGI program to establish an SGML document, fill in a small table, and will generate a partially completed SGML document in the user's Home directory, which can also be loaded in Microsoft Windows. The author can complete this document with your favorite editor. With the CGI program, users can see the changes in documents ('cvs diff') and use HTML to see their SGML document ('cvs commit') before submitting. The author can search for the SGML library (using the GLIMPSE method) and track version changes ('cvs log'). Editing can also use the CGI program to establish schedules. Amazon.com established a basic SGML thin class, and then established some subclasses to perform refining of different parts of the website in different modes (including HTML with pictures, there may be Pointcast, XML, BRaille, etc. Wait). All code is written using Perl. It uses CGI and HTML :: Parser modules. Case 10 - Special print server in New England Hospital Using twelve operating systems in hospital systems in New England, from mainframes to personal computer systems. There are seven different network protocols. There are nearly 10,000 sets of PCs and two thousand sets of printers, and a thousand special printers. This network is distributed throughout the city, using microwave, T1, T3, and fiber. What we have to do is to achieve network printing. Since the special printer is used to print the patient's injection and account information in each proprietary network, it is connected to the IBM large host by transferring the network. The present goal is to use standard protocols to print these documents with standard printers. After looking for a variety of suitable expandable printing service systems, the Palladium of Mit Project Athena can be found as a good development basis. However, it is independent print server system, which does not meet our requirements, and the hospital needs a distributed server. We spend two months, I hope to transfer Palladium to the hospital's platform and then do some modifications, but in the end we discove this too economical. Finally, we decided to build our system, use Perl as a core program, TCL / TK makes the GUI management interface. Palladium has 30000 row source code, and our more complex distributed server system only has the first version of the 5000 line of Perl and the four people's workload. This Perl program runs fast enough on a 60MHz Pentium machine running UNIX, so it is not necessary to rewrite any code with c. Case 11 - Purdue University Network Computing Center In the future, calculation processing is possible to take network-based service model, similar to today's power supply and telephone system architecture.

转载请注明原文地址:https://www.9cbs.com/read-60686.html

New Post(0)