While writing perl cgi scripts, when we need to add css or js files, there are two ways to add the file, one using absolute path, one using relative path.
First we want to check the document root of our file, we cat get it using the following way.
1 2 3 4 |
|
For example, in my case, it gives out the following result:
1
|
|
We assume that our server name is gopid.com, in the /usr/local/www/apache22/ dir, there are the data dir, cgi-bin dir, we make a sub-dir named steven in the data dir, then we can using the following two ways to site the css and js files.
1 2 |
|
Or using the absolute path:
1 2 |
|
PS, if we want to print out the whole env infomation using cgi, we can using the following script:
1 2 3 4 5 6 7 8 9 |
|