--- John Way <[EMAIL PROTECTED]> wrote:
> Does anyone know how to get a perl script to write out each line of code to
> an output (log) file as it performs each line? (Other than a print
> statement after everyline) I've looked in the perlrun documentation, but
> could not find anything.
I don't know if this is possible. If anyone has any suggestions for you, I'd be eager
to see
them.
In the meantime, here's one thought:
use Devel::TraceMethods qw ( PackageOne PackageTwo );
This would allow you log all function calls. If you have good, modular code, this can
track
what's going on for you. You can find this at:
http://theoryx5.uwinnipeg.ca/CPAN/data/Devel-TraceMethods/TraceMethods.html
You could also try Devel::DProf.
perl -d:DProf somescript.pl
Then, to dump a list of function calls:
dprofpp -U
See 'perldoc Devel::DProf' and 'perldoc dprofpp'. These should be included with your
Perl
distribution so there's nothing extra to download.
Also, you might here someone suggest that you write a script that will insert the
print statements
for you. This is likely to be problematic. If the script is small, a script that
inserts the
print statements could be hacked together, but then you'd have to go in and fine-tune
it. If your
script is large, it ain't gonna work. Remember the old adage: only Perl can parse
perl.
If you wanted to try the latter route (the idea is to parse your script, grab each
statements and
insert a print statement after it containing the statement), you should work up
something with
Parse::RecDescent. However, I think it is *very* unlikely that anyone is going to be
successful
with this. I only toss it out because I'm sure it's crossed *somebody's* mind.
Cheers,
Curtis "Ovid" Poe
> My objective is to get a file that can be checked in case of an error to
> see where the program blew up.
> Is there a better way to do accomplish this?
> I am trying to emulate the "set verify" command from VMS DCL
>
> Thanks,
>
> John Way
>
>
>
>
> **** Confidentiality Notice: *******************************************
> Privileged/Confidential information may be contained in this message
> and is intended only for the use of the addressee. Please advise
> immediately if you or your employer do not consent to Internet e-mail
> for messages of this kind. If you are not the addressee, or person
> responsible for delivering to the person addressed, you may not copy or
> deliver this to anyone else. If you receive this message by mistake,
> please notify the sender immediately by return e-mail. Thank you.
> ************************************************************************
>
>
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
=====
Senior Programmer
Onsite! Technology (http://www.onsitetech.com/)
"Ovid" on http://www.perlmonks.org/
__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]