in reply to Re^4: Links to web page?
in thread Links to web page?

Can it be done with CGI-script?

Sure. The first step would be to generate HTML code for links, i.e. instead of print "$f<br />";, you'd write

print "<a href=\"/chat/$f\"> $f </a><br />";

The exact format of the href="..." depends on how your server is configured to access the file, whether you want it served as a static file, or delivered as a dynamic resource (via another CGI script) with a specific MIME type, or with plain text being rendered into HTML, and such...

BTW, directly generating HTML is just the most primitive form there is...  Normally, you'd use some module (like CGI.pm, or one of the many templating modules/frameworks), which would make your life easier — among other things, by taking care of stuff like escaping special characters in file names properly, etc.