[Webinar] Streamline your web hosting managementRegister Today


open a file for input

Posted on 2000-01-16
Medium Priority
Last Modified: 2010-05-18
Why does the following part of my script result in giving me the error message "COULDNT OPEN FILES.HTML":


$FULL_PATH = "D:\\webs\\websites\\URL.com\\cgi_html\\";

open (CONTENTS, "< $FULL_PATHfiles.html") || &CgiDie ("Couldn't open files.html");


I use the literal path because the URL path alone does not work at all with anything I use it for. I can open a file for OUTPUT but not an existing file for INPUT. My server admin says because they use a WINDOWS NT server that directly executes a PL file, I do not have to set permissions. I thought perhaps it might be something due to an illegal access attempt. Hope this error looks familiar to someone.
Question by:microboard

Accepted Solution

lorentg earned 400 total points
ID: 2357966
should these be \\ or / ?

And, more to the point you need:

In this case you need this because it is looking for a variable with the name FULL_PATHfiles.html in your version and you really want the variable and then the literal.
LVL 85

Expert Comment

ID: 2358215
#a more informative error message like
&CgiDie ("Couldn't open $FULL_PATHfiles.html because $!");
#might have revealed the problem

Author Comment

ID: 2358389
lorentg, all I can say is THANKS!

Featured Post

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans
Suggested Courses

612 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question