Usage of use base in Perl

Source: Internet
Author: User

The use base is used to describe the "base class" in Object-Oriented Programming. To put it bluntly,

Use base somemodule;
It is equivalent to the combination of the following two sentences:

Begin {
Use somemodule ();
Push @ Isa, QW (somemodule );
}
You can also use two or more modules of base at the same time, for example:

Use base QW (FOO bar );
It is equivalent:

Begin {
Use Foo ();
Use bar ();
Push @ Isa, QW (FOO bar );
}
As for what kind of array @ ISA is, it is totally irrelevant to use base,
@ ISA is a special array. For more information about its meaning, see the description in the big camel.

By the way,

Use Foo ();
And
Use Foo;
Is different,
The latter will automatically call the import function in the foo package, but the former will not.

Use base somemodule;
Ratio
Use somemodule;
More than one sentence
Push @ Isa, QW (somemodule );

 

Reprinted: http://blog.csdn.net/zll01/article/details/4520237

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.