Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ModPerl: Embperl

use and Execute differences

 

 

ModPerl embperl RSS feed   Index | Next | Previous | View Threaded


realmerx at gmail

Oct 10, 2007, 1:18 AM

Post #1 of 3 (703 views)
Permalink
use and Execute differences

Hello,

Searched through the documentation and mailing lists but could not find the
exact information.
What are the most important differences between using normal perl module
with:

use Package::Module

$obj = Package::Module->new();

or using

$obj = Execute({object => 'package/module.pl', syntax => 'Perl'});
$obj->new();

When we think about reusability then the first strategy (with use) would be
better since we can later use these modules with other systems.
Also I think memory usage would be more efficient since use only loads
modules when necessary.

But would there be any cases where the latter (Execute) would be more
preferable? And how about its memory usage?

Using Embperl 2.2.0.

With kind regards,
Villu Roogna


richter at ecos

Oct 10, 2007, 5:42 AM

Post #2 of 3 (651 views)
Permalink
RE: use and Execute differences [In reply to]

Hi,

>
> Searched through the documentation and mailing lists but
> could not find the exact information.
> What are the most important differences between using normal
> perl module with:
>
> use Package::Module
>
> $obj = Package::Module->new();
>
> or using
>
> $obj = Execute({object => 'package/module.pl', syntax =>
> 'Perl'}); $obj->new();
>
> When we think about reusability then the first strategy (with
> use) would be better since we can later use these modules
> with other systems.
> Also I think memory usage would be more efficient since use
> only loads modules when necessary.
>
> But would there be any cases where the latter (Execute) would
> be more preferable? And how about its memory usage?
>

Execute does an reload when the source changes and it seaches the same
way as other pages (this is interesting for use with Embperl::Object).
Execute also only loads the module once, like use does. Execute put
every file in a different namespace.

When using with Embperl::Object, you can have the same file in different
directories and depending on the URL a differnt file is called.

Gerald




** Virus checked by BB-5000 Mailfilter **

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe[at]perl.apache.org
For additional commands, e-mail: embperl-help[at]perl.apache.org


realmerx at gmail

Oct 10, 2007, 7:39 AM

Post #3 of 3 (658 views)
Permalink
Re: use and Execute differences [In reply to]

Understood and yes Embperl::Object logic is very useful indeed.

Villu

ModPerl embperl RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.