in reply to Best way to fix a broken but functional program?
Here are my suggestions...
Add a log function:
Then, at the beginning and end of each sub-routine, add:sub log { open (LOG,">>log") || die $!; print LOG "$_[0]\n"; close LOG; }
Then add various log calls when things happen that you're unsure of, tacking vars used. eg:sub sub-name { log("Entering sub-name"); ... log("Leaving sub-name"); }
Adding some vars fom caller() may also give you some added insight.log("querying VAX: $vaxen_query"); execute $vaxen_query; log("SQL query: $mangled_sql_query"); execute $mangled_sql_query;
Once you have some idea what gets sent where and when, you can replan what the scipt does and rewite cleanly.
HTH
cLive ;-)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re (tilly) 2: Best way to fix a broken but functional program?
by tilly (Archbishop) on Aug 23, 2001 at 16:00 UTC |