Re: How to log the output of Mime::Lite ?




<kenhensleys@xxxxxxxxx> wrote in message
news:1151362359.186932.304500@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I have this simple Mime::Lite script quoted below.
It works alright.
But I would like to trace the result of the output.
Something like
set -x in ksh
or anything else similar.
Or some logging?
What should I do and where should I put it?


At the beginning of your script:

open LOG, ">>/path/to/logfile" or die "Can't open log: $!";

Then, throughout your script, whenever you want to write something to the
logfile:

print LOG "Whatever you want to put in the logfile";

And at the end of the script:

close LOG or die "Can't close log: $!";

Cheers,
Rob


.



Relevant Pages

  • [RFC][PATCH 0/7] perf trace: general-purpose scripting support, v2
    ... Here's a belated update to v1 of the trace stream scripting support ... output of 'perf trace' and making it directly available to ... It also builds a general-purpose Perl ... wakeup-latency.pl script, if run for a long enough time, will show ...
    (Linux-Kernel)
  • [RFC][PATCH 6/7] perf trace: Add Documentation for perf trace Perl support
    ... +This perf trace option is used to process perf trace data using perf's ... +Perl script, if any. ... +'handler function' is called for each event in the trace. ...
    (Linux-Kernel)
  • Re: LTT user input
    ... and to that end have taken the existing trace infrastructure ... script for that event (if there's a handler defined for the event ... This gives the script a chance to do whatever Perlish thing it ... syscall totals to individual syscall totals for each pid. ...
    (Linux-Kernel)
  • Re: VG mirroring
    ... Host level migration of EMC frames for HPUX. ... hpux.vgclean - Per volume group clean-up script. ... Initialize the tables by running "ksh hpux.start". ... Look at inq.*.txt to see what devices come from what frame. ...
    (comp.unix.admin)
  • Re: [Long] about ksh93 (Was: Bourne Shell Programming on Windows)
    ... :>: Are you saying that David Korn is an unitiated or ignorant ksh ... :> won't be called in a script. ... :> in every shell. ... that should be teached in every shell programming book. ...
    (comp.unix.shell)