Hi,
Both server are NT.
here is new_reader.pl ( it is supposed to insert the headlines of articles into page using SSI) :
#!/usr/local/bin/perl
###################################################################
###################################################################
push (@INC, "j:\\laith\\htdocs\\cgi-bin\\entertainment\\movies\\reviews\\");
require "config.pl";
$head="$tempdir\\newshead.plate";
$foot="$tempdir\\foot.plate";
$sorry="$tempdir\\sorry.plate";
$list="$tempdir\\list.plate";
&parse_form;
$ticker=0;
&open_file("DATAFILE","",$datafile);
$read_file ;
&read_template($incoming=$head);
foreach $line (sort(date_sort &read_file("DATAFILE")))
{
# split the fields at the | character
@tabledata = split("\t",$line ,10);
$snuffy="yes";
&check_record;
## BEGIN VIEW
if ($field6 eq "published" ){
$counter++;
&read_template($incoming=$list);
}
}
## END VIEW
close(DATAFILE);
if ($counter==0) {
&read_template($incoming=$no_news);
}
&read_template($incoming=$foot);
exit;
sub read_template {
$field2link=$field2;
$field2link=~ s/ /%20/g;
local (%listvals) = ("!FIELD1!", "$field1", "!FIELD2LINK!", "$field2link", "!FIELD2!", "$field2", "!FIELD3!", "$field3", "!FIELD4!", "$field4", "!FIVE!", "$five", "!FIELD6!", "$field6", "!FIELD7!", "$field7", "!FIELD8!", "$field8", "!FIELD9!", "$field9", "!FIELD10!", "$field10", "!FIELD11!", "$field11", "!FIELD12!", "$field12", "!FIELD13!", "$field13");
local ($template) = "$incoming";
open(TEMPL, "$template") | | print "no file found $template!";
$template = "";
while(<TEMPL> )
{
$template .= $_;
}
close(TEMPL);
for $ikey (keys(%listvals))
{
local($value) = $listvals{"$ikey"};
$template =~ s/$ikey/$value/gm;
}
print "$template\n";
}
Both server are NT.
here is new_reader.pl ( it is supposed to insert the headlines of articles into page using SSI) :
#!/usr/local/bin/perl
###################################################################
###################################################################
push (@INC, "j:\\laith\\htdocs\\cgi-bin\\entertainment\\movies\\reviews\\");
require "config.pl";
$head="$tempdir\\newshead.plate";
$foot="$tempdir\\foot.plate";
$sorry="$tempdir\\sorry.plate";
$list="$tempdir\\list.plate";
&parse_form;
$ticker=0;
&open_file("DATAFILE","",$datafile);
$read_file ;
&read_template($incoming=$head);
foreach $line (sort(date_sort &read_file("DATAFILE")))
{
# split the fields at the | character
@tabledata = split("\t",$line ,10);
$snuffy="yes";
&check_record;
## BEGIN VIEW
if ($field6 eq "published" ){
$counter++;
&read_template($incoming=$list);
}
}
## END VIEW
close(DATAFILE);
if ($counter==0) {
&read_template($incoming=$no_news);
}
&read_template($incoming=$foot);
exit;
sub read_template {
$field2link=$field2;
$field2link=~ s/ /%20/g;
local (%listvals) = ("!FIELD1!", "$field1", "!FIELD2LINK!", "$field2link", "!FIELD2!", "$field2", "!FIELD3!", "$field3", "!FIELD4!", "$field4", "!FIVE!", "$five", "!FIELD6!", "$field6", "!FIELD7!", "$field7", "!FIELD8!", "$field8", "!FIELD9!", "$field9", "!FIELD10!", "$field10", "!FIELD11!", "$field11", "!FIELD12!", "$field12", "!FIELD13!", "$field13");
local ($template) = "$incoming";
open(TEMPL, "$template") | | print "no file found $template!";
$template = "";
while(<TEMPL> )
{
$template .= $_;
}
close(TEMPL);
for $ikey (keys(%listvals))
{
local($value) = $listvals{"$ikey"};
$template =~ s/$ikey/$value/gm;
}
print "$template\n";
}