|
Welcome to my blog!
读出服务器本地路径的小CGI程序 |
#!/usr/bin/perl print "content-type:text/html\n\n"; print &mypath; sub mypath{ local $temp; $temp=__FILE__;#执行本地程序的路径 $temp=~ s/\\/\//g if ($temp=~/\\/); if ($temp) { $mypath=substr($temp,0,rindex($temp,"/")); } else { $mypath=substr($ENV{'PATH_TRANSLATED'},0,rindex($ENV{'PATH_TRANSLATED'},"\\")); $mypath=~ s/\\/\//g; } return $mypath; } |
[ 阅读全文 | 回复(0) | 引用通告 | 编辑 ] |
Post by badboy 发表于 2007-9-30 9:29:00
|
|
| |