Gossamer Forum
Home : General : Perl Programming :

No action after CLOSE()

Quote Reply
No action after CLOSE()
Hi,

I have a strange problem:

The first part of the script (html_modify_success) works fine when the save_to_server checkbox (in the record form) is NOT checked; the record is shown and the footer links are visible.

But when the save_to_server checkbox is checked (=yes), the record is shown and stored, but the footer (and all the html code after &html_footer;) doesn't show in the viewed page anymore. Why?

It must have something to do with the open/select/close statements...



sub html_modify_success {
# --------------------------------------------------------
.
.
.
|; &html_record_long(&get_record($in{$db_key})); print qq|
</font></p>
|; if ($rec{'save_to_server'} eq 'Yes') { &html_save_server; }
&html_footer; print qq|
</td></tr>
</table>
</center>
</body>
</html>
|;
}


sub html_save_server {
# --------------------------------------------------------
$newfile = "$in{'Userid'}-$in{'ID'}.html";
open(HTM, ">/home/web1/xxx/HTML/arm/$in{'Userid'}/$newfile") or die "This is the error: $!\n";
select (HTM);
print HTM qq|

html code

|;
close(HTM);
}
Quote Reply
Re: [maco] No action after CLOSE() In reply to
I don't see any reason for it to do that. I think you can remove select(HTM) though as you only just opened the file handle so you don't then need to select it.
Quote Reply
Re: [Paul] No action after CLOSE() In reply to
In Reply To:
I don't see any reason for it to do that. I think you can remove select(HTM) though as you only just opened the file handle so you don't then need to select it.


OK, I've tried that and now it prints 2 records on the screen and the saved html file is 0 bytes big...

Crazy