Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the characteristics of Perl script

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly shows you "what are the characteristics of Perl script", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "what are the characteristics of Perl script" this article.

Characteristics of Perl script

This article describes how to use PerlDBI to interface with MySQL. We will not discuss the fundamentals or architecture of DBI. For information about these aspects of DBI, especially when compared to C and PHPAPI, see Chapter 5.

The example of this paper uses the sample database samp_db, and uses the tables needed by the credit preservation scheme and the historical alliance. If you want to gain a lot from this chapter, * learn something about Perl. If you don't want to, it can be helpful to copy the sample code you see here and write your own Perl scripts, but finding a good Perl book can still be a very valuable investment. There is a book called ProgrammingPerl, and the second edition is written by Wall, Christiansen, Schwartz and Potter (published by O'Reilly Press 1996). (machinery Industry Publishing House has published "detailed explanation of Perl5 programming" in 1999. )

The current version of ◆ DBI is 1.13, but most of the introduction here can also be used in earlier 1.xx versions. Note that features that did not appear in the earlier versions introduced are described.

The DBI of MySQL requires a Perl version of at least 5.004x05. You must also install the Msql-Mysql module and the Data-DumperPerl module, as well as the MySQLC client library and some header files. If you plan to write Web-based DBIPerl scripts, use the CGI.pm module. In this article, this module is used to connect to the ApacheWeb server. If you need to obtain such a package, see Appendix A. Instructions for obtaining the sample Perl scripts developed in this chapter are also given in this appendix. You can download these Perl scripts without having to type them yourself.

To a large extent, this article introduces the methods and variables of PerlDBI only for discussion purposes. For a more comprehensive list of all methods and variables, see Appendix G. If you want to use any part of DBI, you can use this appendix as background material for further research. You can get the online documentation by running the following command:

% perldocDBI

% perldocDBI::FAQ

% perldocDBI::mysql is at the database driver (DBD) level, and MySQL's driver is based on the MySQLC client library, so it has some of its features. For more information about the library, see Chapter 6.

◆ Perl scripts are text files that can be created using any text editor. All Perl scripts in this chapter follow the conventions of UNIX, with the line'#!' First, then the path name of the program to be used to execute the Perl script. The lines of * are as follows:

#! / usr/bin/perl

If on your system, the pathname is not Perl, such as / usr/local/bin/perl5 or / opt/bin/perl, you need to modify'#!' All right. Otherwise, the Perl script will not run correctly on the system.

In'#!' There is a space after that, because some systems interpret'#! /'as a 4-byte weird number, so if there is no space, ignore this line, which treats the corresponding Perl script as a shell Perl script.

On UNIX systems, the Perl script should be made executable so that it can be executed simply by typing its name. To make the Perl script executable, make the following changes to the file mode:

% chmod+Xscript_name

If you use ActiveStatePerl under Windows, instead of making the Perl script executable, run a Perl script as follows: C:\ > perlscript_name

These are all the contents of the article "what are the characteristics of the Perl script?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report