use warnings; use strict; use IPC::Run3; my $stdin = q{exec javasplat.create_test_list('tests.txt',} .qq{ '$startStr', '$endStr');}; run3 ['sqlplus','-s','username/password@host'], \$stdin or die "run3 failed"; $? and die "external command failed, \$?=$?";