Help - Search - Member List - Calendar
Full Version: query
WorkTheWeb Forums > Webmaster Resources > Perl Beginner Help
Support our Sponsors!
Madhurima Das
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 numbern";
my $x = <STDIN>;
chomp $x;

print "enter the second numbern";
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#
QUOTE
$ 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#
QUOTE
$ 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

Chris Devers
On Thu, 7 Jul 2005, madhurima das wrote:

QUOTE
I have the following problem:

Yes. We saw it each of the previous times you posted it.

While you were posting this message twice and another one three times --
please don't ever do that again, by the way, thanks -- you got back
several useful responses.

Did you read any of the responses? Clearly it seems that you didn't,
because they had specific recommendations for ways to fix your program
that you still aren't correcting.

Send your messages *once*. Read the responses you get. Act on those
responses. If you still need help, demonstrate how the fix didn't do
what you need to have done, and explain what you're confused about.

If you have to have an "early response", a free, volunteer list may not
be the best alternative available to you :-)

If you're just going to keep posting your work requirements, maybe the
right thing would be to pay someone to do the work for you. There are
several people on the list that would be happy to do your work for you
for a reasonable fee.

Alternatively, read the responses people have already sent back to you.


--
Chris Devers


PHP Help | Linux Help | Web Hosting | Reseller Hosting | SSL Hosting
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2005 Invision Power Services, Inc.