Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Are many use statements a code smell?

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

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


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 17, 2005 at 20: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
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.