As LanX already said, that string ("<A NAME=... HREF=...>...</A>") is likely being returned from the subroutine. So you should look for the place where the subroutine is being called. For example, it may say something similar to print $fh make_href();, in which case the string will be printed to the filehandle $fh, or something like my $var = make_href();, in which case the string is being stored in the variable $var for further processing and probably eventually printing. If you could show some actual code, that would help in answering your question better - see http://sscce.org/