how to run a command-line program from Perl/Tk (ExecuteCommand?)



I have a suite of related programs, of which the one intended mainly for
end-user use is a graphical app using Perl/Tk; the other two are support
programs in straight Perl. I'd like to be able to run the Perl programs
from the graphical application with the output displayed in a window -
what's the best way of doing this?

I've looked at Tk::ExecuteCommand, but have my doubts that this is the
right way to go because so far it doesn't seem to work on the first
platform I've tried it on, i.e., FreeBSD 6.1. (I want this to work
cross-platform, including Windows and GNU/Linux, in addition to FreeBSD.)

For those who may not be familiar with it, FreeBSD has a ports system,
but since Tk::ExecuteCommand doesn't have a FreeBSD port, I downloaded
and built the module myself from CPAN. The "make" went OK, but running
"make test" showed the following output:

PERL_DL_NONLAZY=1 /usr/bin/perl "-Iblib/lib" "-Iblib/arch" test.pl
1..12
# Running under perl version 5.008008 for freebsd
# Current time local: Fri Oct 26 13:26:41 2007
# Current time GMT: Fri Oct 26 17:26:41 2007
# Using Test.pm version 1.25
ok 1
ok 2
ok 3
Proc::ProcessTable missing, can't kill sub-children. at \
blib/lib/Proc/Killfam.pm line 22.
ok 4
ok 5
ok 6
ok 7
ok 8
ok 9
ok 10
ok 11
ok 12

Adding "use Tk::ExecuteCommand;" to my application also results in a
message:

Proc::ProcessTable missing, can't kill sub-children. at \
/usr/local/lib/perl5/site_perl/5.8.8/Proc/Killfam.pm line 22.

and adding a minimal use using the Tk::ExecuteCommand documentation
example as a model doesn't work.

So, what's my best bet here - looking for a fix to Tk::ExecuteCommand,
or finding an alternate way of running my command-line programs inside
a graphical window (keeping in mind that I'm looking for a cross-
platform solution)? If the latter, can anyone suggest an outline of
how to do this?

- Will
.



Relevant Pages

  • Re: how to run a command-line program from Perl/Tk (ExecuteCommand?)
    ... I'd like to be able to run the Perl programs ... from the graphical application with the output displayed in a window - ... platform I've tried it on, i.e., FreeBSD 6.1. ... According to CPAN, Proc::ProcessTable works on BSD, you ...
    (comp.lang.perl.tk)
  • Re: Get Windows Task-Names?!
    ... > Purl Gurl wrote: ... -12189 MSGSRV32.EXE work window name HighCriteria TotalRecorder Mrqx1FQGyj4c1kycrB ... "Power Meter" although this meter is not running. ... which is highly adaptable to Perl. ...
    (comp.lang.perl.misc)
  • Windows: stop automatic closing of the terminal
    ... I had longstanding problems with Activestate Perl under Windows XP ... which closed the terminal window too early. ... the terminal window is closed almost ... I thought I should add something which prompts for a keystroke at the ...
    (perl.beginners)
  • Re: distributing perl applications
    ... And Perl doesn't ... > there is no pause at compilation. ... I think bytecode does that but I may ... elimination of the "ugly black window". ...
    (comp.lang.perl.misc)
  • Re: Window control program help needed Jan. 24, 2006
    ... I would like Perl to send characters etc. to the Windows operating ... >> system as if the instructions were being entered from the keyboard. ... However if a text file for example is the active window and you enter ...
    (comp.lang.perl.misc)