CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Re: [Strider] redircting output of one script as input to another: Edit Log



msds
User

Sep 30, 2002, 10:01 PM


Views: 2574
Re: [Strider] redircting output of one script as input to another

Smile Hello David, the code which I'm trying to execute
, in which nothing gets written to fiop.txt, is already
present at the beginning of the thread .But here it is again anyway.:

Code
 
prog1.pl:

sub first{
$result="firstoutput";
open OUTPUT,'>op.txt' or die $!;
print OUTPUT $result;
close OUTPUT;
}

1;

prog2.pl:

sub second {
open OUTPUT,'op.txt' or die $!;
while($result2=<OUTPUT>) {
open SUGGEST, '>inpsug.txt' or die $!;
print SUGGEST "\nThe soundex code of the word is:";
print SUGGEST $result2;
close OUTPUT;
close SUGGEST;
}
}

1;

prog3.pl:

sub third {
open SUGGEST, 'inpsug.txt' or die $!;
while($finp=<SUGGEST>) {
#print "\n$finp";
open FOUPT, '>fiop.txt' or die $!;
print FOUPT $finp;
close FOUPT;
close SUGGEST;
}
}

1;

main.pl:

require "prog1.pl";
require "prog1.pl";
require "prog1.pl";

do first();
do second();
do third();

Thanx, msdsSmile


(This post was edited by davorg on Oct 1, 2002, 1:27 AM)


Edit Log:
Post edited by davorg (Thaumaturge) on Oct 1, 2002, 1:27 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives