Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: How do I detect what modules are not being used?

by Fletch (Bishop)
on Apr 07, 2005 at 02:49 UTC ( [id://445518]=note: print w/replies, xml ) Need Help??


in reply to How do I detect what modules are not being used?

I'd be very wary about doing this completely automatically. There's nothing stopping someone from calling an arbitrary method $somePkg->$someMethod( "blah" ), with either of those variables set at runtime. You'll need to be looking very closely at all of the code, otherwise can't be sure that there's not some code path that's setting $somePkg to something you've removed since you never saw it called.

Update: And a similar caveat for plain subroutine calls if there isn't a use strict; there could be &{"${somePkg}::$sub"}() calls to who knows what. Granted this probably unlikely (I wouldn't write code that way), but be aware of the possibility.

Update: You should probably get your boss to spring for a copy of Refactoring (ISBN 0201485672) as well.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-19 21:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found