in reply to CGI script not working properly with Internet Explorer

You really should stop using javascript (yes, that includes onclick) and use regular links (print $co->a(-href => "first.cgi?dir=test"). Furthermore, please review the HTML that is generated -- it is much easier to debug. In fact, I don't even recommend using CGI to generate HTML tags.