#!/usr/local/bin/perl -wT use strict; use TEST::App::MainApp; $SIG{__WARN__} = \&warn_handler; redirect_error_log("/export/home/rdave/logs/error_log"); my $app = TEST::App::MainApp() $app->run_loop(); use constant MAX_MSGLEN => 1022; sub warn_handler { my $msg = join "", @_; # print to STDERR $msg = "[" . "$$|" . time2iso() . "] " . $msg; # send in chunks, if necessary while (length $msg > MAX_MSGLEN) { my $chunk = substr($msg, 0, MAX_MSGLEN); $msg = substr($msg, MAX_MSGLEN); warn $chunk, "\n"; } warn $msg; }