Home > Archive > PERL Beginners > December 2007 > Application
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
|
| Hi All,
I have got an application which is not a GUI developed in C. I need to
enter the data from notepad and enter in the place which prompt me for
the correct data. I am storing in the order in which its prompting.
can any one provide me the guidence of how to go about. can it be
acheived using perl.
Thanks
| |
| Yitzle 2007-12-24, 10:04 pm |
| On 12/24/07, Alma <almatirkey@gmail.com> wrote:
> Hi All,
>
> I have got an application which is not a GUI developed in C. I need to
> enter the data from notepad and enter in the place which prompt me for
> the correct data. I am storing in the order in which its prompting.
> can any one provide me the guidence of how to go about. can it be
> acheived using perl.
>
> Thanks
The program (porabably) reads data from STDIN (standard input).
Windows and Unix allow you to "pipe" a textfile to STDIN so that when
the program tries to read from STDIN, it will get the contents of the
file.
Usage: say I got a program called program.pl and an input file called
input.txt, both in the same directory. To pipe, execute the program as
follows:
program.pl < input.txt
| |
| Nobull67@Gmail.Com 2007-12-24, 10:04 pm |
| On Dec 24, 6:58 am, almatir...@gmail.com (Alma) wrote:
> Hi All,
>
> I have got an application which is not a GUI developed in C. I need to
> enter the data from notepad and enter in the place which prompt me for
> the correct data. I am storing in the order in which its prompting.
> can any one provide me the guidence of how to go about. can it be
> acheived using perl.
You may simply be able to run the program with its input fed via a
pipe.
open(my $process, '-|', 'myprogram', 'and','its','arguments') or die
$!;
print $process "$_\n" for @the_input;
I you need more than this then I "Expect" (hint,hint) there's
something on CPAN to help.
See also, the FAQ.
|
|
|
|
|