Simple I/O to a command-line process? 
Author Message
 Simple I/O to a command-line process?

I have been assigned to build a simple GUI interface to an existing
command-line utility.

OS:  WNT/W2k
Language:  ActivePerl/Tk

I have seen talk about fileevent, socket, handle and pipe but the
documentation is sparse.  What is the best way to go about this?  Below
is my test script, it shows the 3 different types of I/O I may need to
account for.  I have the Perl/Tk script written and it is working fine
except for connecting the I/O from running this script to the rest of
my program.  Thanks.

     #!/usr/local/bin/perl -w

     use strict;

     my $choice;

     print "This is line #1\n";
     print "This is line #2\n";
     print "Would you like to print line #3? [y]\n";
     $choice = <STDIN>;
     chomp($choice);
     if($choice eq "y")
     {
       print "This is line #3\n";
     }
     print "Would you like to print line #4? [y]";
     $choice = <STDIN>;
     chomp($choice);
     if($choice eq "y")
     {
       print "This is line #4\n";
     }

--
Posted via CNET Help.com
http://www.*-*-*.com/



Mon, 24 Nov 2003 03:30:14 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Simple reordering of command line arguments.

2. A simple question about command line variables...

3. ANNOUNCE: Getopt::Long 2.9 -- Universal command line options processing

4. HELP: Command line processing

5. patch1 for wafeperl 0.2 to allow xt command line argument processing

6. ANNOUNCE: Getopt::Long 2.6 -- Universal command line options processing

7. Perl command line processing, Windows/dos style ?

8. Processing command line.

9. HELP: Command line processing

10. Processing command line

11. basic query about command line processing in Perl

12. ANNOUNCE: Getopt::Long 2.9 -- Universal command line options processing

 

 
Powered by phpBB® Forum Software