USER command - help
Kenneth Brody
kenbrody at spamcop.net
Sat Jul 11 20:23:25 PDT 2009
flavius m wrote:
>
> Hello,
>
>
> I would like to use the "USER" command to communicate from a Filepro processing to an external perl script. I couldn't make it work and I would appreciate if somebody can help me out with a program sample or the modification of the below example I tried.
ObAnswer: Define "didn't work".
What happened when you tried it?
If you run the Perl script from the command prompt, and type "ver1" and
"ver2", does it respond as you expect?
> Input processing
> ------------------------
> 1 ------- - - - - - - - - - - - - - - - -
> @wlf1 ? If: ?
> Then: USER tst=/appl/fp/test ?
> 2 ------- - - - - - - - - - - - - - - - -
> ? If: ?
> Then: tst="ver1"; aa=tst; tst="ver2"; bb=tst; tst="quit"; ?
> 3 ------- - - - - - - - - - - - - - - - -
> ? If: ?
> Then: display; ?
> 4 ------- - - - - - - - - - - - - - - - -
> ? If: ?
> Then: end
>
>
>
>
> The perl script :
>
>
> #!/usr/bin/perl
>
>
> my $string = ();
>
>
> while ( ($string = <STDIN>) ne "quit\n" ) {
> chomp($string);
> if( "$string" eq "ver1"){
> print "This is version 1\n";
> }
Insert "else" here
> if( "$string" eq "ver2"){
> print "This is version 2\n";
> }
Add a catchall "else" here:
else { print "Oops. I didn't recognize \"$string\"\n"; }
> }
> close(FILE);
> The result should be that I can see on my screen the two texts coresponding to ver1 and ver2 in the dummy fields "aa" and "bb".
But, what _was_ the result?
--
Kenneth Brody
More information about the Filepro-list
mailing list