Author: coar
Date: Tue Mar  9 15:53:17 2010
New Revision: 920935

URL: http://svn.apache.org/viewvc?rev=920935&view=rev
Log:
Make the status output optional

Modified:
    labs/pulse/analysis/listex-load.pl

Modified: labs/pulse/analysis/listex-load.pl
URL: 
http://svn.apache.org/viewvc/labs/pulse/analysis/listex-load.pl?rev=920935&r1=920934&r2=920935&view=diff
==============================================================================
--- labs/pulse/analysis/listex-load.pl (original)
+++ labs/pulse/analysis/listex-load.pl Tue Mar  9 15:53:17 2010
@@ -43,7 +43,7 @@ my $dsn = "DBI:$ENV{PULSE_DBMS}"
     . ":host=$ENV{PULSE_DB_HOST}";
 my $dbx = DBI->connect($dsn, $ENV{PULSE_DB_USER}, $ENV{PULSE_DB_PASSWORD},
                        {
-                        RaiseError => 0,
+                        RaiseError => 1,
                         PrintError => 1,
                        });
 
@@ -78,11 +78,15 @@ my $moderators;
 
 $infile = 'STDIN' if ($infile eq '-');
 debug(2, "Reading from $infile");
-my $ifh = \*STDIN;
+my $ifh;
 if ($infile ne 'STDIN') {
     $ifh = gensym();
-    open($ifh, '<' . $infile)
+    open($ifh, '<' . $infile) || die("Error opening '$infile': $!");
 }
+else {
+    $ifh = \*STDIN;
+}
+
 while (my $line = <$ifh>) {
     $line =~ s§[\r\n\s]+$§§g;
     chomp($line);
@@ -151,7 +155,7 @@ $dbx->{PrintError} = $oldprinterr;
 
 for (my $i = 0; $i <= $#{$xml_parsed->{site}}; $i++) {
     my $site = $xml_parsed->{site}->[$i];
-    print $site->{name}->[0] . "\n";
+    debug(3, $site->{name}->[0]);
     for (my $j = 0; $j <= $#{$site->{list}}; $j++) {
         my @dbargs;
         my $dmsg;
@@ -217,7 +221,7 @@ for (my $i = 0; $i <= $#{$xml_parsed->{s
             $dbq = $dbx->prepare($sql);
             $dbq->execute(@dbargs);
         }
-        print '  ' . $list->{name}->[0] . "\n";
+        debug(3, '  ' . $list->{name}->[0]);
     }
 }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to