Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Are many use statements a code smell?

by borisz (Canon)
on Jun 12, 2005 at 13:42 UTC ( [id://465952]=note: print w/replies, xml ) Need Help??


in reply to Are many use statements a code smell?

I do not think there is something wrong with much use statements. As long as every of the modules has a independent usage/sense without the others.
Otherwise you could refactor it into one module with subclasses.
Stu::AddressBook Stu::AddressBook::Account Stu::AddressBook::Email ...
where Stu::AddressBook use the other module parts and your script just start with
use Stu::AddressBook; my $ab = Stu::AddressBook->new;
Boris

Replies are listed 'Best First'.
Re^2: Are many use statements a code smell?
by crenz (Priest) on Jun 18, 2005 at 00:24 UTC

    And Stu::AddressBook could do something like

    use Module::Find; useall Stu::AddressBook::Plugins;

    which uses Module::Find (caveat: I wrote it ;-)) to find Stu::AddressBook::Plugins::Account, Stu::AddressBook::Plugins::Email, and so on.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://465952]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2024-04-25 07:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found