Forum Moderators: coopster & phranque

Message Too Old, No Replies

Perl Questions

         

cham3l3on35

6:57 am on Jun 6, 2002 (gmt 0)



Ok so i'm stuck again... I have to write a script that takes in a dir (full of test files), and one by one passes those test files into two different programs... then it has to compare the output from those two programs using diff.... i'm not really sure how to pass the files to the programs and then how to save thier output into new files.... any help would be great! it's gonna be a long night....

Brett_Tabke

7:01 am on Jun 6, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



How do you pass any file to the two programs?

cham3l3on35

7:04 am on Jun 6, 2002 (gmt 0)



cat <filename> ¦ goodprogram
so far i have it reading the dir into an array and taking the file from there into the above... i'm not sure if it will work yet....

cham3l3on35

8:02 am on Jun 6, 2002 (gmt 0)



ok so i figured most of this out... but it keeps complaining that it can't locate diff

Brett_Tabke

8:41 am on Jun 6, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



so you can pass the same way with back ticks (that calls a shell).

$results =`cat fname ¦ your program`;
print $results;

Just be sure that "fname" has been parsed for monkey biz.

Brett_Tabke

9:47 am on Jun 6, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



As show above "print $results"

That will tell you the return from the command.