Click to See Complete Forum and Search --> : file paths


2muchtime
05-11-2003, 07:44 PM
Ok, in my small bit of trining in perl scripts, I have failed to discover how I can create and open files in a different path than the directory the script is in. I need this because I want to create html pages witha cgi script and save them to my documents directory f my server. This should be simple to do, but I don't know how, and it will be very helpful.

pyro
05-11-2003, 08:06 PM
You need to make sure that the directories are read/writeable. ie. CHMOD the directories so the script can write to them.

2muchtime
05-12-2003, 01:10 PM
ok, but then how do I reference a different directory is it the "../" to move up the directory structure?

jeffmott
05-12-2003, 07:06 PM
is it the "../" to move up the directory structureIt probably would have been quicker to simply test it yourself than wait for an answer here.

But the answer is yes.open FH, '../file' or die $!;

2muchtime
05-13-2003, 01:15 AM
Alright my mission is to create a script that will generate a calendar based on data entered into a form. My next problem is how can I create a page that can create a new form for each month. Is there a time function that would let me determine what month it is? Or would it be better to just begin with one calendar and from there define all the months.

jeffmott
05-18-2003, 10:32 AM
Is there a time function that would let me determine what month it is?http://www.perldoc.com/perl5.8.0/pod/func/gmtime.html