From 5f93d42b8c5164f2444d5f4ba29ed47611d7dfde Mon Sep 17 00:00:00 2001
From: Aaron Trevena <aaron.trevena@gmail.com>
Date: Sun, 26 Oct 2008 20:32:05 +0000
Subject: [PATCH] multiline warnings

git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@594 48953598-375a-da11-a14b-00016c27c3ee
---
 lib/Apache/MVC.pm | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lib/Apache/MVC.pm b/lib/Apache/MVC.pm
index 84fbd21..0f99fbf 100644
--- a/lib/Apache/MVC.pm
+++ b/lib/Apache/MVC.pm
@@ -117,9 +117,15 @@ sub warn {
   my ($package, $line) = (caller)[0,2];
   my $ar = $self->parent ? $self->parent->{ar} : $self->{ar};
   if ( $args[0] and ref $self ) {
+    my @lines = split /\n/, (join '', @args);
+    $ar->warn("[$package line $line] ".shift(@lines));
+    foreach(@lines) {
+      next unless $_;
+      $ar->warn(" $_");
+    }
     $ar->warn("[$package line $line] ", @args) ;
   } else {
-    print "warn called by ", caller, " with ", @_, "\n";
+    print STDERR "warn called by ", caller, " with ", @_, "\n";
   }
   return;
 }
-- 
2.39.5