Hi haj, that ttml file was incorrect. This is the correct one
[%# template.ttml %]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<TITLE>Some title</TITLE>
<meta http-equiv="refresh" content="$link" />
</head>
<body>
<center>
</center>
<form action="">
</form>
</body>
</html>
The idea with all of this, is when this cgi is executed, every processed url appears in a new tab. But first url does that, second url does not do anything. I made changes to cgi script to see that it reached after loop is executed and it efectively did. That is why I mention that second url is not executed.