in reply to using eval or equivalent to automatically generate my statements

Does your script have tests?

Before you make any changes you should
1) know what the program is supposed to do
2) know what it actually does currently
3) know the difference between what it does and what its supposed to do (a buglist)
4) have an automatic way (a programmatic way) of checking the program does what its supposed to do

I would start by writing tests :) saving all changes in version control

Then maybe use B::Xref to identify most isolated chunks to turn into good and proper subs that take arguments and return values, and take on increasingly messier stuff

Now, PadWalker can help you get at the stuff, and you an use local or even Data::Alias

get lexical via PadWalker/Lexical::Util, and globals(locals) via %package::

You might try Binding

This may be of interest Splitting a project into smaller files, general advice finding duplicate code

Good luck

  • Comment on Re: using eval or equivalent to automatically generate my statements

Replies are listed 'Best First'.
Re^2: using eval or equivalent to automatically generate my statements
by ISAI student (Scribe) on Dec 14, 2012 at 13:32 UTC
    Yes, it has tests, I've refused to touch it w/o them. I'll have a look at the references. The company I work for use svn, and I already use it. I've learned to use VC, the hard way. Thanks!