Your description is a little lacking in what about you're looking to do. From the sounds of it, you're parsing html files locally on the webserver and you want the script to find the DocumentRoot and look in there to do things. If that's what you mean, and you're looking to deploy this on several machines with DocumentRoot's in various places, I can only see two ways.
1. Statically configuring each script or creating a config file to live with the script that contains the directories to parse.
2. Reading the configuration file for the web server to find the DocumentRoot (or similar IIS thingy), BUT you'd need to know where that file lives.
wait, thought of something else.. You might want to check CPAN out, I believe
File::Find will grant you the ability to quest for all *.htm* files on a given system.
But like I said, from this description its a bit difficult to get a clear idea of what you're trying. When I read the title, I thought of the CGI::url() method that I use alot in my CGI scripts:
use CGI;
my $c = new CGI;
my $SCRIPT = $c->url( -absolute=>1 );
That just gives me the absolute path from the server root to use with page navigation from a client side browser.
anyways, if you clarify some more, perhaps I can offer more assistance.
-brad..
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.