CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
Doubt in Perl

 



rajsalem
Deleted

Jun 6, 2000, 2:50 AM

Post #1 of 2 (554 views)
Doubt in Perl Can't Post

Hi ,

How to open a .DOC file through a perl program and to copy the same .doc file to other file through Perl program? and also i want to insert this into mysql database.
Kindly reply us soon as the matter is urgent.
Thanks
Rajkumar


Cure
User

Jun 15, 2000, 9:31 AM

Post #2 of 2 (554 views)
Re: Doubt in Perl [In reply to] Can't Post

Something like this ->

use File::Copy;
use DBI;
use CGI ();

copy("file1","file2");

my $DSN = "DBI:mysql:test";
my $user = "username";
my $pw = "secret";
my $q = CGI->new;

my $dbh = DBI->connect($DSN) or die "Cannot connect: $DBI::errstr\n";

my $query = q!INSERT INTO table_name (column_one)
VALUES ("file2")!;

my $sth = "$dbh->do($query) or die "Could not prepare '$query'. Reason: '$DBI::errstr'";

$dbh->disconnect;

Cure

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives