At 03:07 PM 2/19/98 -0800, Earl Hood
<ehood(_at_)hydra(_dot_)acs(_dot_)uci(_dot_)edu> wrote:
Yes. The only problem I have found is that I/O redirection does
not appear to work. For example:
> mhonarc.pl -single message.822 > message.html
Does nothing. message.html is created, but it has no data. The
HTML data vanishes. Doing
> mhonarc.pl -single message.822
does cause the HTML data to be printed to the screen. But it appears
I cannot capture it.
Mailbox/folder processing appears to work okay.
Try putting your command line in a batch file wrapper somewhere along the
path. Here's an example;
@rem = '--*-Perl-*--';
@rem = '
@echo off
:: Runs Perl and launches a script.
:: Arguments: whatever you like
:: I/O redirection symbols ( > | < ) get stripped by Windows. Use the caret
notation (^>) instead.
perl.exe %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
if errorlevel 10 goto perlerror
if errorlevel 1 goto badparam
goto done
@rem ';
BEGIN{ @INC = qw(C:/perl/lib C:/perl/scripts); } ## reset as needed
## This is a logging facility. Call it from within your script like this:
&LogMe($some_message);
sub LogMe
{
$msg = shift;
use Win32::EventLog;
$Event = {'EventType' => EVENTLOG_INFORMATION_TYPE,
'Category' => 0,
'EventID' => 1,
'Data' => $msg,
'Source' => $testee,
'Computer' => $ENV{'COMPUTERNAME'}};
Win32::EventLog::Open($logger, "PerlTest") && $logger->Report($Event);
}
## This nicely formats any Win32 errors. You can use it with the logger
above: &LogMe(&Error);
sub Error
{
use Win32;
$! = Win32::GetLastError;
return Win32::FormatMessage($!);
}
## Do your Perl thing here. DOS parameter %0 is the batch file name of this
script.
## It's also the first argument to perl (line 6). Massage the caret
notation here and
## handle redirection within this script. Use the exit function to return
an errorlevel
## to the batch file wrapper.
__END__
:perlerror
@echo Unexplained Perl error!
goto done
:badparam
@echo Usage: thisfile your_parameters
@echo thisfile = script (FQPN if not in current directory)
:done
@echo on
--- end script ---
I use MHonarc on NT v3.51 with Activestate Perl build 315, no problems.
-> http://www.concordia.net/
Home of the Cybernautic Hiker's Guide(tm)