R
Raistlin Majere
print "Content-type: text/html\n\n";
open(OLDLIST, "<link list.txt");
open(NEWLIST, ">link list.tmp");
$count=1;
$line1="";
$line2="";
foreach $line(<OLDLIST>)
{
chomp($line);
if($count==1)
{
$line1=$line;
};
if($count==2)
{
$line2 =~ s/Suggested Text/$line1/;
print NEWLIST $line2."\n";
};
if($count==3)
{
$count=0;
};
$count++;
};
close(NEWLIST);
close(OLDLIST);
# what is wrong?
open(OLDLIST, "<link list.txt");
open(NEWLIST, ">link list.tmp");
$count=1;
$line1="";
$line2="";
foreach $line(<OLDLIST>)
{
chomp($line);
if($count==1)
{
$line1=$line;
};
if($count==2)
{
$line2 =~ s/Suggested Text/$line1/;
print NEWLIST $line2."\n";
};
if($count==3)
{
$count=0;
};
$count++;
};
close(NEWLIST);
close(OLDLIST);
# what is wrong?