1) yes.
2) look around here: [cpan://mysql]
$/ = q#(\w)# ; sub sig { print scalar reverse join ' ', @_ } sig
map { s$\$/\$/$\$2\$1$g && $_ } split( ' ', ",erckha rlPe erthnoa stJu" );
this one page two page thing is confusing,
is this a file upload ?
taking address? what the h*ll are you talking about ?! :-)
mysql stuffs... perl is really sexy with db stuff.. here's a rough example.. (i said rough!)..
use DBI;
my $CONECTION = DBI->connect("DBI:mysql:database=$databasename; host=$hostname", "$username", "$password", { RaiseError=>1, AutoCommit=>1}) or die $DBI::errstr ;
my $insert = $CONNECTION->prepare("INSERT INTO yourtable (col1, col2, col3) values (?,?,?)");
# if you are gonna be executing the same thing more then once,
# you want to 'prepare' it and then execute it as needed,
# you dont wanna prepare and execute the same thing over
# an over again, depends on your load..
$insert->execute('val1','val2','val3');
$insert->finish;
$CONNECTION->disconnect;
The Perl code is going to probably be something like this:
#!/usr/bin/perl
use strict;
use CGI;
use DBI;
my $cgi = new CGI;
my $dbh = DBI->connect("DBI:mysql:dbname:localhost","username","password");
my $fh = $cgi->upload('file');
my $data;
$data .= $_ while <$fh>;
my $p = $dbh->prepare("insert into `tablename` (`address`,`data`) values (?,?)");
$p->execute($cgi->param('address'), $data);
$p->finish;
$dbh->disconnect;
Although this is rather basic (and untested!!), I hope it leads to an eventual solution to your problem, of course, assuming that I am understanding it correctly :-).
--
By a scallop's forelocks!
perlmonks.org content © perlmonks.org and Adrade, chargrill, Khatri, leocharre
prlmnks.org © 2006 edmund von der burg (eccles & toad)
v 0.03