Top Note - you may wish to choose one of the
groups to email - vice hitting them all....
On Saturday, June 8, 2002, at 06:57 , aman cgiperl wrote:
> I have a code that looks like the following
>
> $pgs = 1000;
> $lks = "Welcome Message";
> for($i=0;$i<$pgs;$i++) {
> open PGIN, "/$char/$mn/index_tmp".$i.".html";
> open PGOUT, ">/$char/$mn/index".$i.".html";
> while(<PGIN>) {
> $_ =~ s/##MSG##/$lks/g;
> print PGOUT $_;
> }
> close PGIN;
> close PGOUT;
>
> This code creates index pages from index_tmp pages. The problem is that
> the created pages are not complete. I mean the new pages don't have the
> complete html written from the index_tmp pages. This results some visible
> html code in IE and as expected, due to html error, nothing in Netscape.
> Any suggestions?
plan A: make sure that all the files in
/$char/$mn/
would be valid HTML webPages in their own right
and hence only the ##MSG## would be showing up as
'silly data' - hence your code as is would do what
you want it to do.
plan B: look at how to pull of the html template model
instead....
plan C: use CGI.pm - build your own PhrameWork and parse
the directories you want with an alternative strategy...
say something like:
http://www.wetware.com/drieux/pbl/cgi/ginIndex.txt
granted that would work as a filter and should be updated
with the usual Getopt::Long front ending to set your
source and destination sorts of things - rather than
hardwiring in the base-ref and base_dir....
Ok we had to play hardball with CGI.pm's mental constraints
that it wants to gin on the fly resolve:
$webPage .= start_html(-title=>$title, base=> 'true');
with a little clean up of what it does...
$webPage =~ s!http://.*!http://$base_ref">!;
freaking code - I can make you do what I want....
ciao
drieux
---
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]