rhxk has asked for the wisdom of the Perl Monks concerning the following question:
If my $body or $subject has the following#!/usr/bin/perl -w use strict; use DBI; use Mail::Internet; my $dbase = "python"; my $driver = "DBI:mysql"; my $user = 'morongo'; my $passwd = 'llama'; my $dbh = DBI->connect("$driver:database=$dbase",$user,$passwd) or + die "Can't connect"; my $msg = new Mail::Internet \*STDIN; my $from = $msg->head->get('From'); my $to = $msg->head->get('To'); my $date = $msg->head->get('Date'); my $subject = $msg->head->get('Subject'); my $body = join('',@{$msg->body}); $dbh->do("INSERT INTO agency (AgencyName,Email) Values('CNN','$to')"); $dbh->do("INSERT INTO article (Subject,CNNDate,SenderEmail) Values('$s +ubject','$date','$from')"); $dbh->do("INSERT INTO body (Body) Values('$body')"); $dbh->disconnect;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: perl mysql question
by halley (Prior) on Nov 05, 2005 at 23:36 UTC | |
by tinita (Parson) on Nov 06, 2005 at 00:47 UTC | |
by pg (Canon) on Nov 06, 2005 at 02:45 UTC | |
by Thilosophy (Curate) on Nov 06, 2005 at 07:00 UTC | |
Re: perl mysql question
by sh1tn (Priest) on Nov 05, 2005 at 23:35 UTC | |
Re: perl mysql question
by davidrw (Prior) on Nov 06, 2005 at 00:50 UTC | |
Re: perl mysql question
by Evil Attraction (Novice) on Nov 07, 2005 at 10:01 UTC | |
Re: perl mysql question
by kulls (Hermit) on Nov 08, 2005 at 04:27 UTC |