PDA

View Full Version : Perl OUTFILE help



Thursty
07-02-2007, 09:47 PM
Quick question from a newbie to HM... :o

Its been a long time since I have used Perl scripts & cgi, but it is kind of like riding a bike. I have written a couple web pages for collecting some basic information, my question is when it goes to write in the OUTFILE portion of my Perl scripts. They all seem to be writing to the cgi-bin. How can I change the location to another directory? IE a data directory

currently this is what I have been using-
open (OUTFILE, ">>xyz.dat");

HM says the The path to my site on the server would be:

/home/username/

Where "username" would be your username assigned when you signed up with Hostmonster.

I have tried-
open (OUTFILE, ">>/home/~mydomain/data/xyz.dat");

with no luck. :confused:

Any insight would be appreciated!

Thanks in advance!
-Thursty

r2b2
07-03-2007, 12:55 AM
Remove the ~ (i.e. just use /home/mydomain/data/...)

The ~ is probably expanding itself to be /home/username/ ...

Thursty
07-03-2007, 07:10 AM
Remove the ~ (i.e. just use /home/mydomain/data/...)

The ~ is probably expanding itself to be /home/username/ ...

I tried that as well... still no luck. :(

r2b2
07-03-2007, 04:11 PM
I'm assuming the data directory exists? (It won't probably create directories itself). (Just making sure on this one - I'm sure it is :) )

Is there anything being written out to an error log somewhere? (Perhaps in the Cpanel Error logs page)

Thursty
07-03-2007, 05:41 PM
I'm assuming the data directory exists? (It won't probably create directories itself). (Just making sure on this one - I'm sure it is :) )

Is there anything being written out to an error log somewhere? (Perhaps in the Cpanel Error logs page)

:o Well, it wasn't where it needed to be.... I added /public_html so it reads-

open (OUTFILE, ">>/home/mydomain/public_html/data/xyz.dat");

now it appears to be working! Thanks for the insight! :cool: