I have a simple menuing program where the items for the menu are read from a file in the following format:
user level| link text | link url , eg
It is read in using the following:
However the variables such as $id are reproduced in the final url ($add) in their unevaluated form. How can I force them to be replaced by their values?
user level| link text | link url , eg
Code:
0|Shop|cgi-bin/vc_shop.pl?id=$id&level=$level&where=shop
It is read in using the following:
Code:
while ($atext=<OFILE>)
{
@item=split(/\|/,$atext);
$ulevel=$item[0];
$utext=$item[1];
$ulink=$item[2];
$add="<a href=\"$ulink\">$utext</a><br>";
$text=$text.$add;
}
close(OFILE);
return $text;