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);