OK -- We're getting close. See what you think? One of the problems still reamaining is escaping "@" in email address.
If anyone insterested this is a little c.y.a script I'm creating to track server outages . Thanks again David
#!/usr/bin/perl -w
use strict;
use DBI;
my ($dbh,$sth,@row,$server,$date,$date_closed,$contact,$contact_email,
+$contact_phone,$planned,$event,$resolution);
print "Enter sever name: "; $server=<STDIN>; chomp($server);
print "Enter Date (YYYY/MM/DD): ";$date=<STDIN>;chomp($date);
print "Date Closed(YYYY/MM/DD): ";$date_closed=<STDIN>;chomp($date_clo
+sed);
print "Contact: ";$contact=<STDIN>;chomp($contact);
#print "Contact Email: ";$contact_email=<STDIN>;chomp($contact_email);
print "Contact Phone: ";$contact_phone=<STDIN>;chomp($contact_phone);
print "Planned Event(yes/no): ";$planned=<STDIN>;chomp($planned);
######################################################################
+######
# Define multi-line fields
$/ = "^A";
print "Describe Event:\n";
$event=<STDIN>;chomp($event);
print "\n";
print "Describe Resolution:\n";
$resolution=<STDIN>;chomp($resolution);
######################################################################
+########
$dbh = DBI->connect("dbi:mysql:sirinfo","rca","rcaS7ay0u7")
or die "Nice try buckaroo\n";
$sth = $dbh->prepare("INSERT INTO rca(server,date,date_closed,
contact,contact_phone,planned,event,resolution
VALUES('$server','$date','$date_closed','$contact
+','$contact_phone','$planned','$event','$resoluti
on')")
or die "No cigar\n";
$sth->execute();
$dbh->disconnect();
exit;
|