Perl Best Practices (excerpt)---09

Source: Internet
Author: User
Tags scalar
The Nineth chapter: one of the sub-procedures.

call the subroutine with parentheses, but do not add & at the beginning. one.

do not get the same noun as the built-in function. one third.

to remove the @_ first. one of the restaurants.

use a named argument hash for any subroutine that has more than three parameters. Yi Wu.

use an argument that has no definition or exists to test for gaps. one land.

The @_ is removed and immediately resolves any default argument values. one QI.

The scalar return value must be returned by scalar. one BA.

returns the "obvious" value in the scalar context of the subroutine that returns the list. one, nine.

when there is no "obvious" scalar context return value,

you might consider using Contextual::return instead. 0.

do not use sub-program prototypes. one and one.

returned by an explicit return. A.

Use simple return to return the failure.

Perl Best Practices (excerpt)---09

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.