On Sun, 10 Jun 2001 [EMAIL PROTECTED] wrote:

> I have recently came across a mod_perl document that suggested Perl's
> Method Interface is more 'memory friendly' compare to Perl's Function
> Interface.
>
> I'm not too sure I've got the meaning of this 'Method Interface' and
> 'Function Interface' correctly, is it referring to the procedural
> function call and the Object Oriented Method invoking?  or is it trying
> to suggest to use 'use' instead of 'require'?

Quite a lot of Perl modules allow you to "import" functions or even
variables, that means to make them available within your current
namespace. (e.g. you can call "foo()" instead of "Foo::foo()"). Some of
them even export functions per default.

This importing requires adding entries into the so called "symbol table",
which then of course means consuming more memory.

So it's basically suggesting you either use the object oriented interface
- if available - ( Foo->foo() ) or you use fully qualified function names
( Foo::foo() ). Also, as a rule of thumb, to avoid importing functions,
you can use require instead of use as this usually even avoids importing
default exports.

-- 
Markus Peter - SPiN AG
[EMAIL PROTECTED]


Reply via email to