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 is the Perl programming format?

2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article is about what the Perl programming format is like. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Perl programming format Guide

Name

P5EEx::Blue::perlstyle-P5EE style Guide P5EE is an abbreviation for Perl5EnterpriseEnvironment (Enterprise Perl5 style Guide).

Introduction to Perl programming format

In the P5EE distribution, all the code and files included follow the style described in this article. Please note: these styles are not meant to dampen your creativity, but to make life easier for people who read your code. He can also be used to resolve differences and avoid personal disputes. The following conventions apply to perl modules, web programs (CGI/mod_perl), and command-line programs. Of course, these rules also apply to perl code written in P5EE to some extent.

Note that these are guiding policies, not rules that must be followed. If you really need to violate one of these rules here, anyway, ask the P5EE core team first. In addition, most of this document does not emphasize that the right approach is our approach. We need to make some agreements to make everyone's life easier. If you have any questions, you can ask in the P5EE development mailing list, the files required for the p5eeroomperl.org. Http://lists.perl.org/showlist.cgi?name=p5eeP5EE project can be found on the following websites. Http://p5ee.perl.org/http://www.officevision.com/pub/p5ee this document will be updated over time, and changes in previous versions will be recorded at the end of each document.

Perl coding rules of Perl programming format

Perl version

We write all the code on perl5.005_03. Maybe one day we should take advantage of the following features of perl5.6. In any case, all code should work on perl5.005_03 and subsequent versions. All of P5EE's core code has been tested on perl5.005_03 and perl5.6.0, although P5EE is now more commonly used on perl5.6.

Documentation in Perl programming format

All module documentation should be written with reference to the POD examples in the module template file, explaining the method, purpose, and purpose of the module, and each common API with name, description, input, output, affected factors, and other information. In the document, if you need to return a reference to an array or hash table, record the size of the array (including an appropriate description of what each element is) and the name of each key in the hash table. If it is a composite data structure, try to describe the appropriate structure. In addition, record the type of value of the returned data in the document. Is it an integer, a piece of HTML code, or a Boolean value? The options for all command-line programs are recorded using the code in the command-line program sample file. Every effective method, switch structure, etc., is recorded, along with a description of the method, purpose, and how the program is used. Do not try to use the same options for programs for different purposes. For all WEB programs, the function, purpose, and use should be described in the program comments section. Any external documents, command line programs, and module documents should be written in POD style. In this way, we can convert them into other documents in various formats through a variety of pod2xxx converters.

POD is not a formal markup language, it's just a way to make documents very easy to convert to other formats. If you have any questions, you can take a look at the perlpod help page that comes with Perl or ask us and other people who understand POD. In the FPC of the Perl China Promotion Group, there is also an article about [[how to write POD] written in [[fayland]].

Version of Perl programming format

Use the code version of the module, the web program, and the command line program sample file respectively. The $VERSION in the module will reflect the version of CVS. The Makefile.PL file should contain a version description and should not depend on the version of any individual file in the CVS repository. Similarly, the XS module with $VERSION will reflect the release version, otherwise every time you make a change to the file, you need to recompile the libraries that are already shared. This is indeed a pain for people engaged in development work. Our distribution number uses tuples mode, * the number is the major subscription number, the second number is the version number, and the third number is the subversion number. The Odd-numbered version number is the development version.

Thank you for reading! This is the end of this article on "what is the Perl programming format?". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

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