On Tuesday, May 28, 2002, at 09:48 , Eric Preece wrote:
[..]

> #########################
> #  sub to get rss input from htm form and write it to a file
> #########################
> sub getInput {
[..]
>       my $template = "rss_outtemplate.htm";
>       my $tempHTML ='';
>       my $fullOutfile = "rss.asp";
[..]
>       
>       #########################
>       # format the form data using a template
>       #########################
>       open(FILEFULL, $template) or die ("Couldn't open template file - 
> $template - $!\n"); # <-- script dies right here, but only from web form.
[..]
>       #########################
>       # write the form data with template to the dump file
>       #########################
>       open(FILESTOR,"> $fullOutfile") or die ("Couldn't open $fullOutfile - 
> $!\n");
>       print FILESTOR $tempHTML;
>       close FILESTOR or die ("Couldn't close  $fullOutfile - $!\n");
>       
>       #########################
>       # rename the dump file with datestamp
>       #########################
>       $newName = $fileTag. "rss.asp";
>       rename $fullOutfile, $newName or die ("Couldn't rename rss out file - 
> $fullOutfile - $!\n");
>       return $newName;
> }
[..]

Jonathan's point is correct. Since your 'bare word' - or
'not fully qualified pathname' may not be in the directory
where your process is invoked.

just to provide the alternative here - since you have
both an 'incoming file you wish to read in, and one
that you wish to write out, you may wish to do the
old saw:

        my $inDir = '/some/path/to/Bob/Here';
        my $outDir = '/some/safe/place/to/Scribble';

hence you would only need to modify


        my $template = "$inDir/rss_outtemplate.htm";
        my $tempHTML ='';
        my $fullOutfile = "$outDir/rss.asp";

and the rest should fly....

Note that when you use this as the template for your next
piece of CGI work - all you need to do is change the
dirVals - and BOING you rewrite even LESS code...

Remember there is no 'gurantee' where you process will
be relative to the underlying file system when it is invoked.

Hence if the webSite natively spawns all cgi applications in

        /var/run/www/Wacko/PanikFreakSpace

and your files are somewhere's else... it will not see them.
hence will throw the

        "No such file or directory"


ciao
drieux

---


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to