the error message I got was: Can't open : No such file or directory at c:\webserver\osarr.org\www\cgi-bin\bb.pl line 67.

If you took my code (altered die statement) and pasted it in your script verbatim, than you experience something odd, for it doesn't return the value of the $tempfile variable in the die statement, alas, it looks like either you made a typo somewhere, or $tempfile is not set right. I take it this is a script you fetched from some online source, but if you're willing to improve it a little (call that a bunch) you might want to look into strict to prevent typos.

Looking at your original code again, I now notice (either I missed it before, or you changed it in the meanwhile) the following, which doesn't make much sense to me:

$bbfile="c:\\webserver\\osarr.org\\www\\member\\bboard\\bb.html"; $tempfile="c:\\webserver\\osarr.org\\www\\member\\bboard\\bb.html"; [...] rename("$bbfile", "$bbfile.old"); rename("$tempfile", "$bbfile");

This is not going to work. Both $bbfile and $tempfile point to the same file. The first rename function, changes bb.html into bb.html.old, leaving $tempfile clueless, for the file bb.html is gone. Try changing the value of $tempfile to something like:

$tempfile="c:\\webserver\\osarr.org\\www\\member\\bboard\\bb.html.tmp" +;
which is this line: $tempfile="c:\\webserver\\osarr.org\\www\\member\\bboard\\bbtemp.html";

No, the line number returned, will most likely point to:

open(TEMPFILE,">$tempfile") || die("Can't open $tempfile: $!");

That line contains the die statement that killed your script, if I recall correctly. I also wonder why the file in $tempfile is bbtemp.html now again. It doesn't show that in your original code, as discussed above.

I checked with the hosting co. and they said that the permissions are set read and write. Do I also need execute set on? Thanks What does this mean?

I'm not very familiar with the Windows file system, so other monks can probably explain this in greater detail, but if it's anything like a *NIX file system, you will need executable rights on all the directories leading to the file in question:

c:\webserver\ c:\webserver\osarr.org\ c:\webserver\osarr.org\www\ c:\webserver\osarr.org\www\member\ c:\webserver\osarr.org\www\member\bboard\

Then you need write access to the c:\webserver\osarr.org\www\member\bboard\ directory. Not the specific file, but the entire directory, for it seems that this script will recreate the $tempfile every time. Also make sure that the web-server is able to write to that directory, not just you, using your own account. The hosting company should know this and how to set it all up, so that's their burden ;) Also make sure these directories actually exist, and you didn't make a typo in them.

So, now back to the new error message (excuse me for the long post but I try to cover as much as possible) Can't open : No such file or directory at c:\webserver\osarr.org\www\cgi-bin\bb.pl line 67. Please triple check what line 67 exactly is and post that line specifically as you have it. The error you get looks to me like your code looks something like:

open(TEMPFILE, "$tempfile") || die("Can't open $tmpfile: $!");

Please not the > sign in my example, and check the spelling of the $tempfile in the die statement.

--
b10m

All code is usually tested, but rarely trusted.

In reply to Re: Having trouble with a Discussion Board by b10m
in thread Having trouble with a Discussion Board by Ineedhelpplease

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.