One simple question -
I need to accept a file from the user and to store it as temp1.
then I need to give this file as an input of another program :
I wrote a script like this, but it is not working : Help ?

#!/usr/bin/perl -w
use CGI;
my $q = new CGI;
my $file = $q->param('file');
print $q->header();

# Reading file from user and writing to another file temp1
open (FOO, ">temp1");
while (<$file>)
       {
       print FOO $_;
       }
close FOO;

# internaly executing xxx program; taking temp1 as input
`/usr/bin/xxx temp1`;

#temp.xxx is output of usr/bin/xxx
@psa = `cat temp1.xxx`;

foreach $i(@psa)
{
       print "$i";
       print "<br>";
}

--
thanks in advance,
IBK

Reply via email to