Author: coar
Date: Tue Mar  9 15:55:59 2010
New Revision: 920942

URL: http://svn.apache.org/viewvc?rev=920942&view=rev
Log:
Get the DB access stuff from the environment

Modified:
    labs/pulse/email-query/listex-report.pl

Modified: labs/pulse/email-query/listex-report.pl
URL: 
http://svn.apache.org/viewvc/labs/pulse/email-query/listex-report.pl?rev=920942&r1=920941&r2=920942&view=diff
==============================================================================
--- labs/pulse/email-query/listex-report.pl (original)
+++ labs/pulse/email-query/listex-report.pl Tue Mar  9 15:55:59 2010
@@ -1,4 +1,4 @@
-#! /usr/local/bin/perl -w
+#! env perl -w
 #
 # Extract the body of a mail message and treat each line in it as a
 # regex for matching mailing lists on which to report.
@@ -138,7 +138,7 @@ else {
     my $reply = new Mail::Mailer('sendmail');
     my %header = ('Subject'        => "Re: $subject",
                   'To'             => $from,
-                  'Bcc'            => '[email protected]',
+                  'Bcc'            => '[email protected]',
                   'From'           => ('Apache Mailing List Info '
                                        . '<[email protected]>'),
                   'Content-Type'   => 'text/plain',
@@ -201,8 +201,10 @@ sub fetchdata {
     # Now connect to the database.
     #
     debug(4, 'Connecting to the database');
-    my $dsn = 'DBI:mysql:database=<dbname>:host=<dbfqhn>';
-    my $dbx = DBI->connect($dsn, '<username>', '<password>',
+    my $dsn = 'DBI:' . $ENV{PULSE_DBMS}
+        . ':database=' . $ENV{PULSE_DB_NAME}
+        . ':host=' . $ENV{PULSE_DB_HOST};
+    my $dbx = DBI->connect($dsn, $ENV{PULSE_DB_USER}, $ENV{PULSE_DB_PASSWORD},
                            {
                             RaiseError => 0,
                             PrintError => 0



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

Reply via email to