Opinions on the Design of Perl

G

g3000

Hello,
I have a question about the design of Perl5. What advantages does
exporting symbols of module have over allowing method calls?
Bascially what are the strengths and weaknesses of each approach.
 
A

AaronJSherman

"I have a question about the design of Perl5"

Ok....

"What advantages does exporting symbols of module have over allowing
method calls"

Well, that's not really a Perl 5 design issue at all. You can do
either, and there are times that either or both make sense.

It really depends on how your module will be used. If it's going to be
used in a primarily OO style, then it makes sense to treat everything
(including your module) as an object. If, on the other hand, someone is
going to be doing things in a procedural way with your module, then you
might want to export.

Exporting, of course, leads to naming conflicts (e.g. "get" from
LWP::Simple), so you probably want to export only requested symbols
and/or symbol sets.
 
A

Anno Siegel

"I have a question about the design of Perl5"

Ok....

"What advantages does exporting symbols of module have over allowing
method calls"

Well, that's not really a Perl 5 design issue at all. You can do
either, and there are times that either or both make sense.

It really depends on how your module will be used. If it's going to be
used in a primarily OO style, then it makes sense to treat everything
(including your module) as an object.

A Perl module is never an object in a meaningful sense. You probably
meant to say "class".

Anno
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top