I have a text string, with some HTML code, that I truncate (using substr). In some instances, I truncate off some HTML close tags.
In the case of anchor tags, I do this (please tell me if there is a more elegant ay to do this!): if ($text =~ /\<a href/ && $text !~ /\<\/a\>/) {$text .= '</a>';} But I realized that this doesn't work if there is more than one link, like so: Here is <a href="#">some text</a> that got <a href="#">truncated Any suggestions? Chris -------------------------- Chris Schults Web Production Coordinator Grist Magazine 811 First Avenue, Suite 466 Seattle, WA 98104 Phone: 206-876-2020, ext. 204 Fax: 253-423-6487 <http://www.grist.org> To sign up for Grist by email, the world's top environmental news served up with a sense of humor, click here <http://www.grist.org/signup/> or send a blank email message to <[EMAIL PROTECTED]> -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>