I BioKid wrote:
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>";
}

Can u explain whats your requirement little more clearly.

You mean reading the file name from the user and copying the file to temp1 and then using this temp1.

then you can use the

`cp file1 temp1`

and then to use it in another file.

If not please explain it little more :(

--
Prabu.M.A
When I was born I was so surprised
        I didnt talk for a period and half
                                 -Gracie Allen


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to