in reply to Auto linking to words in a text file

this is very simplistic and only works within a line. also, i hadn't seen that you wanted the links to be in the data file, so this won't totally work. oh well.
#!/usr/bin/perl -w use strict; use URI::Escape; chomp(my @words = <DATA>); my $re_text = join '|', map quotemeta, @words; my $re = qr/\b($re_text)\b/; while (<>) { s/$re/build_link($1)/ge; print; } sub build_link { my $word = shift; sprintf '<A HREF="/index.pl?node=%s">%s</A>', uri_escape($word), $word; } __END__ foo bar baz PerlMonks