Tonigth i chnages the scheme of my perl webpage
instead of having index.html redirect to cgi-bin\index.pl
i set in httpd.conf DirectoryIndex index.html cgi-bin/index.pl
but all links to other ple scripts inside my index.pl not workign any
more cause thye y were relative.
Then i changed them alla links to files an folders to absolute
startinf with a leading / (d:\www which is my DocumentRoor)
Now script can work but
but statements like :
my @files = glob "/data/text/*.txt";
and
my @tips;
open FILE, "/data/text/tips.txt" or die $!;
@tips = <FILE>;
close FILE;
arent opening files or loading them into arrays.
The paths though to files ae correct.
I just dont see the error.
Linking fro one cgi to another is handled by the web server but opening/writing is handled by the OS. ok.
But is nt it strange but the same commands used to work without full hdd paths in the past, until yesterday which i deleted the index.html that was pointing to index.pl?
How come then the webserver was able to handle those I/O requests and executed the properly?
i had it like this: cleint request => index.html (d:\www) => index.pl (d:\www\cgi-bin) and it was working ok.
Things changes when i deleted the redirection filer and set DirectoryIndex index.html cgi-bin/index.pl
To put it more simply
When i used to sue the index.html pointing to index.pl all paths i ahd were relative and all I/O functions like fillign an @array with files or opening files used to work with, could be opened and edited without me having to describe the full hdd locations.
How was that possbile?
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.