Thread Shell-Aufruf im PerlScript (Sqlite3) (10 answers)
Opened by Pennpann at 2011-11-16 11:06

Gast wer
 2011-11-16 12:30
#154241 #154241
Würde die Sache anders angehen:
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
my $dir='C:/Daten/DB_Erstellung/';
my $file='import.cmd';
my $cmd='sqlite3 daten.db';

# slurp
my $data=eval{local($/,@ARGV)=(undef,"$dir$file"); <>};

chdir($dir) or die("cd error: $!");

open(my $ph, '|-', $cmd) or die("open error: $!");
print $ph $data;
close($ph);


oder DBI nutzen:
Code (perl): (dl )
1
2
use DBI;
my $dbh = DBI->connect("dbi:SQLite:$dbfile");

View full thread Shell-Aufruf im PerlScript (Sqlite3)