既出だったらすいません。

ランダムで背景画像を変えたくて、
5つの違うCSS(background-imageのみ記述してあります)
をランダムで選び、それをタグに書き出したいと思うんですが
[an error occurred while processing this directive]
とエラーが出てしまいます。

$dir = 'home/自分のID/public_html/nantoka/style';
$url = 'home/自分のID/public_html/nantoka/style';

opendir(DIR, "$dir") || die "Can't open: $dir";
@data = grep(!/^\.\.?$/, readdir(DIR));
closedir(DIR);

srand(time|$$);
$style = $data[rand(@data)];
print qq(<link rel="stylesheet" type="text/css" href="$url/$style">);

exit;

これを、index.shtmlから
<!--#exec cgi="home/自分のID/public_html/nantoka/randomimg.cgi" -->
と呼び出しています(CGI本体とindex.htmlは同じディレクトリにあります)。

dirは使える鯖と使えない鯖がある、という話は聞いたことがあるんですが
どこかおかしな所があったら、教えていただけないでしょうか・・・