in reply to cleaning up code with "do" ?
i *should* use "use" or "require", but since i'm doing some quite messy namespace-stuff (plugins, global dbh's, eval-ed strings that call subs, etc.), that would be a major pain in the behind.
Moving this stuff into an external file will not make your code less messy. In fact, I think it will make it more so. Most of the advantage of modules is not having separate files, but having clean interfaces. I'd even venture to say the clean interface is much more important than the separate files.
Here's what I recommend: clean up the interfaces between your core functions and main code, move the core functions into a package, and then think about making a module out of that package. It may seem like a daunting task, but just pick away at it, and, before you know, it will be tolerable and clean.
If you have any questions about how to clean up something specific, you can always post a new question at the Monastery. If there's anything the Monks can do, it's rework a piece of code. :^)
|
|---|