Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Importing files with perl::dbi

by httptech (Chaplain)
on Jun 23, 2000 at 05:37 UTC ( [id://19542]=note: print w/replies, xml ) Need Help??


in reply to Importing files with perl::dbi

use DBI; my $dsn = "DBI:mysql:foobar"; my $user = "foobar"; my $pass = "baz"; my $textfile = "testing.txt"; open (TEXT, "$textfile") or die "Couldn't open textfile: $!"; $dbh = DBI->connect($dsn, $user, $pass,{ RaiseError => 1}) or die "Could not connect to database! $DBI::errstr"; { local $/ = undef; $dbh->do("INSERT INTO foo (bar) values (?)", undef, <TEXT>); } $dbh->disconnect; close TEXT;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://19542]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2024-05-21 23:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found