I have recently started running perl scripts under the ISAPI dll file and one of my scripts has stoped working. It works fine when I run it under the perl.exe but when I run it under the .dll it does not work. I am not given any error messages but instead of prtingin the content of a few txt files nothing gets printed. To see it working you can look at http://www.ffinfo.com/cgi-bin/headlines.pl and to see what the problem output is go to http://www.ffinfo.com/cgi-bin/headlines.plx Can anyone take a look at the code and tell me what might be wrong?
#!/user/bin/perl -w use strict; use CGI q~:standard~; my ($BasePath, $i, @NewsBoard, @NewsFile, $NewsPost, @News, $ID, @Mont +h, $Sec, $Min, $Hour, $MDay, $Mon, $Year, $WDay, $YDay, $IsDST, $Time +); @Month = ('January', 'February', 'March', 'April', 'May', 'June', 'Jul +y', 'August', 'September', 'October', 'November', 'December'); $BasePath = 'D:/finalfantasyinfo/community'; open (FILE, "$BasePath/boards/news.txt") or die 'Can not open new boar +d file'; @NewsBoard = <FILE>; close FILE; @NewsBoard = sort { $b <=> $a } @NewsBoard; $i = 0; while ($i < 4) { @NewsFile = split (/\|/, "$NewsBoard[$i]"); open (FILE, "$BasePath/messages/$NewsFile[0].txt") or die 'Can not + open News File'; $NewsPost = <FILE>; close FILE; @News = split (/\|/, "$NewsPost"); &ProcessHTML(); $i++; } sub ProcessHTML { $ID = $News[3]; ($Sec, $Min, $Hour, $MDay, $Mon, $Year, $WDay, $YDay, $IsDST) = lo +caltime($News[3]); if ($Min < 10) { $Min = qq~0$Min~; } if ($Hour > 12) { $Hour = $Hour -12; $Hour = qq~$Hour:$Min P.M.~; } else { $Hour = qq~$Hour:$Min A.M.~; } $Year = 1900 + $Year; $Time = qq~$Hour on $Month[$Mon] $MDay, $Year~; $News[8] =~ s/\[(\/)?(b|u|i)\]/<$1$2>/gi; $News[8] =~ s~\[center](.*?)\[/center]~<center>$1</center>~gi; $News[8] =~ s~\[url=(\S+?)\](.*?)\[/url\]~<a href="$1">$2</a>~gi; $News[8] =~ s~\[img](.*?)\[/img\]~<img src="$1" alt="" />~gi; $News[8] =~ s~\s*\[\*\]~</li><li>~isg; $News[8] =~ s~\[olist\]~<ol>~isg; $News[8] =~ s~\s*\[/olist\]~</li></ol>~isg; $News[8] =~ s~</li><ol>~<ol>~isg; $News[8] =~ s~<ol></li>~<ol>~isg; $News[8] =~ s~\[list\]~<ul>~isg; $News[8] =~ s~\s*\[/list\]~</li></ul>~isg; $News[8] =~ s~</li><ul>~<ul>~isg; $News[8] =~ s~<ul></li>~<ul>~isg; $News[8] =~ s~\[ch9679\]~&#9679\;~isg; print qq~<p class="center"><span class="header">$News[0]</span> <br />Posted by: $News[1] at $Time</p> <p>$News[8]</p> <p style="text-align: right"><a href="http://www.ffinfo.com/community/ +YaBB.pl?num=$ID">Discuss this posting.</a></p>~; }

In reply to Scripts work under perl .exe but not ISAPI by Eagle_f91

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.