bradcathey has asked for the wisdom of the Perl Monks concerning the following question:
Fellow Monasterians,
I feel like this is my first day writing Perl. Doing something I've done a million times, writing a text file, but getting a "No such file or directory" error.
my $path ="http://www.domain.com/WysiwygPro/content.txt"; open (DATA, ">$path") or die "can't write content.txt to $path, error: + $!"; print DATA $content; close (DATA);
Returns error:
can't write content.txt to http://www.domain.com/WysiwygPro/content.tx +t, error: No such file or directory at editortest.pl line 44
The directory is indeed there and chmodded to 755. However, when I change the path to relative:
my $path ="../WysiwygPro/content.txt";
..all is fine.
Why would I be getting the error with the absolute? What incredibly elementary thing am I missing? TIA
UPDATE: Wow! I get it. Unix paths != HTTP paths, except in instances like "../foo". Thank you good monks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Write file using full path returns error
by Tanktalus (Canon) on Jan 20, 2005 at 20:59 UTC | |
|
Re: Write file using full path returns error
by Anonymous Monk on Jan 20, 2005 at 21:55 UTC | |
|
Re: Write file using full path returns error
by EverLast (Scribe) on Jan 20, 2005 at 21:17 UTC |