Perl Best Practices (excerpt)---17

Source: Internet
Author: User
Tags perl debugger

The 17th Chapter: module II QI.

design the interface of the module first. BA.

Turn the original code into inline.

Put the duplicated code in the subroutine.

Put the duplicate subroutine into the module. a nine.

use a three-part version number. Ii. 0.

programmatic implementation of your version requirements. Ii.

Export wisely and only when there are requests for possible situations. Ii.

consider exporting in a declarative manner. three.

do not turn variables into part of the module interface. Ii.

automatically creates a new module frame. Ii.

use core modules whenever possible. II-II.

Use the CPAN module when feasible. the 18th chapter: Testing and debugging second-Qi.

Write a test case first. Ii. Ba.

standardize your test cases with test::simple or test::more. Nine.

standardize your test set with test::harness. Ii. 0.

Write a failed test case. three.

both possible and impossible have to be tested. three.

Add a new test case before starting the test. three three.

be sure to use using strict. three.

Be sure to turn on the warning feature explicitly. three.

never assume that no warnings are correct during compilation. three continents.

explicitly and selectively turn off censure (stricture) or warning (warning),

and is within the smallest possible scope. the third seven.

learn at least the subset functionality of the Perl debugger. three ba.

the warning to use serialization when "Manual" debugging. three, nine.

Consider using "smart annotations" instead of warn statements when debugging.

Perl Best Practices (excerpt)---17

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.