If Anyone knows Perl...

Status
This thread has been Locked and is not open to further replies. The original thread starter may use the Report button to request it be reopened but anyone else with a similar issue should start a New Thread. Watch our Welcome Guide to learn how to use this site.

k_carcrispix

Thread Starter
Joined
Jul 21, 2001
Messages
77
I realize this is a little off-topic, but I'm getting very frustrated with something. I'm going to throw down a little syntax here and see if you can figure out whats wrong. The script works, as far as I don't get an error message, but it simply doesn't do the following, which basically adds a thread to a list on an html page, like a bulletin board. For copyright issues, this script is partially derived from Matt from Matt's Script Archive.

sub main_page {
open(MAIN,"$imagedir/$galpage") || die $!;
@main = <MAIN>;
close(MAIN);

open(MAIN,">$imagedir/$galpage") || die $!;
foreach $main_line (@main) {
if ($main_line =~ /<ul>/) {
print MAIN "<ul>\n";
print MAIN "<li><a href=http://www.nevermind.com/pics/$pictitle.html>$pictitle</a>\n";
}
else {
print MAIN "$main_line";
}
}
close(MAIN);
}

All the variables are properly defined and the sub itself is called properly. Since I don't get an error I'm assuming it does run through the sub, but for some reason doesn't add the HTML to the file.
Again, this might not be a good question to post here, but you folks have always helped me out with my headaches, however strange they were, and this one is giving me quite a doozy.

ps) that bullet and link are just generated by the board...it should say the actual HTML in there

Thanks, DAN
 
Status
This thread has been Locked and is not open to further replies. The original thread starter may use the Report button to request it be reopened but anyone else with a similar issue should start a New Thread. Watch our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top