Reputation: 111
I need to run perl script through tcl script, but exec command in tcl is not generating the results of perl script.
tcl script (test.tcl) has following line
exec perl test.pl
perl script test.pl has following lines.
use strict;
use warnings;
print "Have a nice day!!!";
I am running tcl through cmd window as "tclsh test.tcl". No errors and no output. Why it is so???
Upvotes: 0
Views: 808
Reputation: 16436
exec
command will return the output of the program and you have to capture it by saving it into a variable, or straightaway print it using puts
.
set result [exec perl test.pl]
puts $result
Upvotes: 1