X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=scripts%2Fndmail.pl;h=f6fe444bed890b3d80c4bbd09550b8c8725ddbca;hb=3b0d1d881162c5bcc1a18e8a43c807cc1fe52bc3;hp=a47a33c50702941eac1d5d9158bc2066ab132478;hpb=c643b311c8f134a59625192b900aa28b3f12d4f1;p=ndwebbie.git diff --git a/scripts/ndmail.pl b/scripts/ndmail.pl index a47a33c..f6fe444 100755 --- a/scripts/ndmail.pl +++ b/scripts/ndmail.pl @@ -22,6 +22,7 @@ q{ use strict; use warnings; +use local::lib; use DBI; use DBD::Pg qw(:pg_types); use CGI qw/:standard/; @@ -31,15 +32,11 @@ use Email::StripMIME; use Encode::Encoder qw(encoder); use MIME::QuotedPrint; -our $dbh; -for my $file ("/home/whale/nddb.pl") -{ - unless (my $return = do $file){ - warn "couldn't parse $file: $@" if $@; - warn "couldn't do $file: $!" unless defined $return; - warn "couldn't run $file" unless $return; - } -} +use FindBin; +use lib "$FindBin::Bin/../lib"; +use ND::DB; + +my $dbh = ND::DB::DB(); my @text = <>; my $text = join '',@text;