> Thanks for your suggestions Jonathan, that seems to stop the script
> from looping now there is another problem with it!!!  it falls over
> saying "can't open newpage at 74 - No such file or directory at
> /web/cgi/AZcreate.pl line 74" but the idea is that this file will be
> created when printing to PAGEOUT, have I got it all wrong?  I Have
> marked the line in script below, I would be really gratfull for any
> suggestions on how to cure this..
> 
> ...
> ...   open(PAGEIN, "<$path/ExhibitionFolder/98/Templates/$NEWPAGE")
> ...       or die("Cannot open template: $!\n");
> ...   open(PAGEOUT, ">$folder/$Exname/$NEWPAGE") 
> ...       or die("can't open newpage at 74 : $!\n");######## this is line
> 74

You probably haven't initialized $folder, or maybe the file specifies
a directory which doesn't exist.

To get a better idea of the problem (and as a general rule), always
include offending data in error messages, e.g.

    my $infile = "$path/ExhibitionFolder/98/Templates/$NEWPAGE";
    open(PAGEIN, "<$infile") or die("Can't read template $infile: $!\n");
    my $outfile = "$folder/$Exname/$NEWPAGE";
    open(PAGEOUT, ">$outfile") or die("Can't write $outfile: $!\n");

That should show you which filename can't be opened.

Regards,
Jonathan

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

Reply via email to