query



Sir,

I have the following problem:

I need a perl program which asks the user to input
two numbers x & y. The program next calls a fortran
program to do some calculations with the two numbers x
& y & sends the output z back to the perl program. The
perl program next conveys this output z to the user.

My programming approach to this problem is as
follows:


####PERL PROGRAM####

#assign.pl#

#!/usr/bin/perl

use strict;
use warnings;

print "enter the first number\n";
my $x = <STDIN>;
chomp $x;

print "enter the second number\n";
my $y = <STDIN>;
chomp $y;

my @z = system("assign.f",'$x','$y');

print "Output of the two numbers is:\n";
print @z,"\n";

exit;

#output of assign.pl#
>$ perl assign
enter the first number
2
enter the second number
4
Can't exec "assign.f": Permission denied at assign
line 14, <STDIN> line 2.
Output of the two numbers is:
-1

------------------------------------------------------------

####FORTRAN PROGRAM####

#assign.f#

WRITE(*,*) "ENTER FIRST NUMBER"
READ(*,*) x
WRITE(*,*) "ENTER SECOND NUMBER"
READ(*,*) y
z = x+y
WRITE(*,*)"OUTPUT OF THE TWO NUMBERS IS:"
WRITE(*,*)z
END


#output of assign.f#
>$ g77 assign.f
>$ ./a.out
ENTER FIRST NUMBER
2
ENTER SECOND NUMBER
4
OUTPUT OF THE TWO NUMBERS IS:
6.


So,i'm unable to connect both the programs. Kindly
help with some books or pseudocode or the functions
needed to solve this problem.
Waiting for an early response. Thanking you..





__________________________________________________________
How much free photo storage do you get? Store your friends 'n family snaps for FREE with Yahoo! Photos http://in.photos.yahoo.com
.