sub textify { my ($text, $opt) = @_; my $root_link = base_path('link'); $text =~ s/$root_link\///; # removes the $root_link $text =~ s/_/ /g; # removes undersores $text =~ s/ (Mr|Mrs|Ms|Dr) / $1. /g; # adds a period for Mr, Mrs, Ms, and Dr; I may need to add more $text =~ s/\s&\s/ & /g; # converts ' & ' to & $text =~ s/\.{3}/…/g; # converts '...' to … $text =~ s/(\w|\b|\s|^)'(\w|\b|\s|$)/$1ʼ$2/g; # converts "'" to ʼ # The following takes out html tags unless I tell it not to $text =~ s/<.+?>//g unless ($opt->{'html'} && $opt->{'html'} =~ /^[ytk1]/); # The following takes out parenthes unless I tell it not to $text =~ s/\s\(.*?\)$// unless ($opt->{'parens'} && $opt->{'parens'} =~ /^[ytk1]/); # The following removes file extensions except .com, .net, and .org $text =~ s/\.\w{2,5}?$// unless $text =~ /\.(?:com|net|org)$/; # $text =~ s/(?