in reply to How to track variable usage in a script?

Were I in your position, I would build my self a little sub-routine, let us say "debug", and place calls to it at various places in the code. The arguments to debug are the all variables in the routine.
sub debug { my @vars = @_; my $i; foreach (@vars) { print("Var $i = $_\n"); } print("\n"); return(1); }
(Note: Coded but not tested.)

My calls look like debug("Location", $arg1, $arg2, ....) for however many args you want; I just cut and paste the routine all over the place. (This is as close as I can come to a PL/1 "Put Skip Data".)

We are all Novices in the Monestary.

----
I Go Back to Sleep, Now.

OGB

Replies are listed 'Best First'.
Re: How to track variable usage in a script?
by Abigail-II (Bishop) on Mar 22, 2004 at 16:56 UTC
    Were I in your position, I would build my self a little sub-routine, let us say "debug", and place calls to it at various places in the code.
    Considering that 'print' with a bunch of variables was dismissed as being too much work, how is your 'debug' function going to save work? At least call it 'd', so it saves 4 keystrokes per call....

    Abigail

Re: Re: How to track variable usage in a script?
by Scarborough (Hermit) on Mar 22, 2004 at 16:58 UTC
    Thanks I was here about 3 hours ago and hoped there was a system hash which stored all the user variables which I could interrogate but will go down this line now. Thank you for the encouragement.